From 5bb857476f99118cda0e54ea522f52933a582747 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 21 Apr 2009 17:46:38 -0500 Subject: [svn-r16825] Description: Bring revisions 16636:16821 from trunk to revise_chunks branch Tested on: FreeBSD/32 6.3 (duty) Mac OS X/32 10.5.6 (amazon) (h5committest not needed on this branch) --- MANIFEST | 2 + Makefile.am | 21 + Makefile.in | 28 +- README.txt | 2 +- aclocal.m4 | 35 +- bin/reconfigure | 8 +- c++/Makefile.in | 8 +- c++/examples/Makefile.in | 6 +- c++/src/H5Attribute.cpp | 183 +- c++/src/H5Attribute.h | 3 + c++/src/Makefile.am | 4 + c++/src/Makefile.in | 40 +- c++/test/Makefile.in | 8 +- c++/test/dsets.cpp | 2 +- c++/test/tattr.cpp | 90 +- c++/test/tfilter.cpp | 2 +- config/gnu-flags | 16 +- config/lt_vers.am | 2 +- configure | 111 +- configure.in | 21 +- examples/Makefile.in | 6 +- fortran/Makefile.in | 8 +- fortran/examples/Makefile.in | 6 +- fortran/src/H5Aff.f90 | 454 +-- fortran/src/H5Df.c | 28 + fortran/src/H5Dff.f90 | 478 +-- fortran/src/H5Eff.f90 | 36 +- fortran/src/H5Fff.f90 | 90 +- fortran/src/H5Gff.f90 | 114 +- fortran/src/H5If.c | 30 + fortran/src/H5Iff.f90 | 78 +- fortran/src/H5Lff.f90 | 90 +- fortran/src/H5Off.f90 | 12 +- fortran/src/H5Pf.c | 67 + fortran/src/H5Pff.f90 | 916 +++--- fortran/src/H5Rff.f90 | 48 +- fortran/src/H5Sff.f90 | 188 +- fortran/src/H5Tff.f90 | 354 +- fortran/src/H5Zff.f90 | 18 +- fortran/src/H5_DBLE_InterfaceInclude.f90 | 234 +- fortran/src/H5_f.c | 3 + fortran/src/H5_ff.f90 | 60 +- fortran/src/H5f90global.f90 | 55 +- fortran/src/H5f90proto.h | 9 + fortran/src/Makefile.am | 4 + fortran/src/Makefile.in | 40 +- fortran/src/hdf5_fortrandll.def | 4 + fortran/test/Makefile.in | 8 +- fortran/test/fortranlib_test.f90 | 5 +- fortran/test/fortranlib_test_1_8.f90 | 2 + fortran/test/tH5I.f90 | 24 + fortran/test/tH5P.f90 | 275 +- fortran/testpar/Makefile.in | 8 +- hl/Makefile.in | 8 +- hl/c++/Makefile.in | 8 +- hl/c++/examples/Makefile.in | 6 +- hl/c++/src/Makefile.am | 4 + hl/c++/src/Makefile.in | 40 +- hl/c++/test/Makefile.in | 8 +- hl/examples/Makefile.in | 6 +- hl/fortran/Makefile.in | 8 +- hl/fortran/examples/Makefile.in | 6 +- hl/fortran/src/Makefile.am | 4 + hl/fortran/src/Makefile.in | 40 +- hl/fortran/test/Makefile.in | 8 +- hl/src/H5DS.c | 222 +- hl/src/H5IM.c | 1817 +++++----- hl/src/H5LT.c | 3328 +++++++++---------- hl/src/H5TB.c | 2346 ++++++------- hl/src/Makefile.am | 4 + hl/src/Makefile.in | 40 +- hl/test/Makefile.in | 8 +- hl/test/test_ds.c | 379 ++- hl/test/test_image.c | 463 +-- hl/test/test_lite.c | 1483 +++++---- hl/test/test_table.c | 676 ++-- hl/tools/Makefile.in | 8 +- hl/tools/gif2h5/Makefile.in | 8 +- perform/Makefile.in | 8 +- perform/chunk.c | 2 +- release_docs/RELEASE.txt | 71 +- src/H5.c | 14 +- src/H5AC.c | 4 +- src/H5B.c | 2 - src/H5B2cache.c | 3 +- src/H5B2test.c | 2 +- src/H5Bprivate.h | 2 - src/H5C.c | 3 +- src/H5Dchunk.c | 5 +- src/H5Dscatgath.c | 11 +- src/H5F.c | 16 +- src/H5FL.c | 591 +++- src/H5FLprivate.h | 24 +- src/H5FO.c | 4 +- src/H5FSsection.c | 11 +- src/H5Fpkg.h | 6 +- src/H5Fsuper.c | 20 +- src/H5Ftest.c | 40 + src/H5G.c | 167 +- src/H5Gobj.c | 109 - src/H5Gpkg.h | 7 + src/H5Gprivate.h | 8 +- src/H5Groot.c | 368 +++ src/H5Gstab.c | 3 +- src/H5Gtest.c | 56 + src/H5I.c | 40 +- src/H5L.c | 18 +- src/H5O.c | 2 +- src/H5Ocopy.c | 2 +- src/H5Opline.c | 4 +- src/H5Pdapl.c | 2 +- src/H5Pdcpl.c | 2 +- src/H5Pint.c | 20 +- src/H5SL.c | 859 +++-- src/H5SLprivate.h | 4 +- src/H5Tconv.c | 54 +- src/H5Z.c | 74 +- src/H5Zdeflate.c | 2 +- src/H5Zfletcher32.c | 2 +- src/H5Znbit.c | 2 +- src/H5Zpkg.h | 14 +- src/H5Zprivate.h | 5 +- src/H5Zpublic.h | 26 +- src/H5Zscaleoffset.c | 2 +- src/H5Zshuffle.c | 2 +- src/H5Zszip.c | 2 +- src/H5config.h.in | 3 + src/H5detect.c | 64 + src/H5private.h | 1 + src/H5public.h | 4 +- src/H5trace.c | 2 +- src/H5vers.txt | 1 + src/H5version.h | 16 + src/Makefile.am | 2 +- src/Makefile.in | 19 +- test/Makefile.am | 3 +- test/Makefile.in | 13 +- test/dsets.c | 45 +- test/dtransform.c | 59 +- test/family_v16_00000.h5 | Bin 5120 -> 5120 bytes test/links.c | 84 +- test/objcopy.c | 25 +- test/tfile.c | 65 +- test/tid.c | 43 +- test/tmisc.c | 82 + test/tskiplist.c | 92 +- test/vfd.c | 56 +- testpar/Makefile.in | 8 +- testpar/t_chunk_alloc.c | 114 +- testpar/t_posix_compliant.c | 4 +- testpar/testphdf5.c | 17 +- testpar/testphdf5.h | 2 + tools/Makefile.in | 8 +- tools/h5copy/Makefile.in | 8 +- tools/h5diff/Makefile.in | 8 +- tools/h5diff/h5diffgentest.c | 1040 +++--- tools/h5diff/testfiles/h5diff_201.txt | 2 +- tools/h5diff/testfiles/h5diff_202.txt | 2 +- tools/h5diff/testfiles/h5diff_203.txt | 2 +- tools/h5diff/testfiles/h5diff_204.txt | 2 +- tools/h5diff/testfiles/h5diff_205.txt | 4 +- tools/h5diff/testfiles/h5diff_206.txt | 2 +- tools/h5diff/testfiles/h5diff_207.txt | 4 +- tools/h5diff/testfiles/h5diff_57.txt | 2 +- tools/h5diff/testfiles/h5diff_70.txt | 2 +- tools/h5diff/testfiles/h5diff_80.txt | 6 +- tools/h5diff/testfiles/h5diff_90.txt | 4 +- tools/h5dump/Makefile.in | 8 +- tools/h5dump/h5dump.c | 8 +- tools/h5dump/h5dumpgentest.c | 2 +- tools/h5import/Makefile.in | 8 +- tools/h5jam/Makefile.in | 8 +- tools/h5ls/Makefile.in | 8 +- tools/h5repack/Makefile.in | 8 +- tools/h5repack/h5repack.c | 287 +- tools/h5repack/h5repack.h | 2 +- tools/h5repack/h5repack.sh.in | 9 +- tools/h5repack/h5repack_copy.c | 1594 +++++---- tools/h5repack/h5repack_filters.c | 15 + tools/h5repack/h5repack_parse.c | 6 +- tools/h5repack/h5repack_refs.c | 76 +- tools/h5repack/h5repack_verify.c | 88 +- tools/h5repack/h5repacktst.c | 3462 +++++++++++--------- tools/h5repack/testfiles/h5repack_named_dtypes.h5 | Bin 0 -> 4304 bytes tools/h5stat/Makefile.in | 8 +- tools/lib/Makefile.in | 8 +- tools/lib/h5diff_array.c | 655 +++- tools/lib/h5diff_dset.c | 14 +- tools/lib/h5tools_ref.c | 2 +- tools/misc/Makefile.in | 8 +- tools/testfiles/tall-2A.h5.xml | 2 +- tools/testfiles/tall.h5.xml | 2 +- tools/testfiles/tarray1.h5.xml | 2 +- tools/testfiles/tarray2.h5.xml | 2 +- tools/testfiles/tarray3.h5.xml | 2 +- tools/testfiles/tarray6.h5.xml | 2 +- tools/testfiles/tarray7.h5.xml | 2 +- tools/testfiles/tattr.h5.xml | 2 +- tools/testfiles/tbitfields.h5.xml | 2 +- tools/testfiles/tcompound.h5.xml | 2 +- tools/testfiles/tcompound2.h5.xml | 2 +- tools/testfiles/tcompound_complex.h5.xml | 2 +- tools/testfiles/tdatareg.h5.xml | 2 +- tools/testfiles/tdset.h5.xml | 2 +- tools/testfiles/tdset2.h5.xml | 2 +- tools/testfiles/tempty-dtd-2.h5.xml | 2 +- tools/testfiles/tempty-dtd.h5.xml | 2 +- tools/testfiles/tempty-nons-2.h5.xml | 2 +- tools/testfiles/tempty-nons.h5.xml | 2 +- tools/testfiles/tempty-ns-2.h5.xml | 2 +- tools/testfiles/tempty-ns.h5.xml | 2 +- tools/testfiles/tempty.h5.xml | 2 +- tools/testfiles/tenum.h5.xml | 2 +- tools/testfiles/textlink.h5.xml | 2 +- tools/testfiles/tgroup.h5.xml | 2 +- tools/testfiles/thlink.h5.xml | 2 +- tools/testfiles/tloop.h5.xml | 2 +- tools/testfiles/tloop2.h5.xml | 2 +- tools/testfiles/tmany.h5.xml | 2 +- tools/testfiles/tname-amp.h5.xml | 2 +- tools/testfiles/tname-apos.h5.xml | 2 +- tools/testfiles/tname-gt.h5.xml | 2 +- tools/testfiles/tname-lt.h5.xml | 2 +- tools/testfiles/tname-quot.h5.xml | 2 +- tools/testfiles/tname-sp.h5.xml | 2 +- tools/testfiles/tnamed_dtype_attr.h5.xml | 2 +- tools/testfiles/tnestedcomp.h5.xml | 2 +- tools/testfiles/tnodata.h5.xml | 2 +- tools/testfiles/tobjref.h5.xml | 2 +- tools/testfiles/topaque.h5.xml | 2 +- tools/testfiles/torderattr1.h5.xml | 2 +- tools/testfiles/torderattr2.h5.xml | 2 +- tools/testfiles/torderattr3.h5.xml | 2 +- tools/testfiles/torderattr4.h5.xml | 2 +- tools/testfiles/tref-escapes-at.h5.xml | 2 +- tools/testfiles/tref-escapes.h5.xml | 2 +- tools/testfiles/tref.h5.xml | 2 +- tools/testfiles/tsaf.h5.xml | 2 +- tools/testfiles/tslink.h5.xml | 2 +- tools/testfiles/tstr.h5.xml | 2 +- tools/testfiles/tstr2.h5.xml | 2 +- tools/testfiles/tstring-at.h5.xml | 2 +- tools/testfiles/tstring.h5.xml | 2 +- tools/testfiles/tudlink.h5.xml | 2 +- tools/testfiles/tvldtypes1.h5.xml | 2 +- tools/testfiles/tvldtypes2.h5.xml | 2 +- tools/testfiles/tvldtypes3.h5.xml | 2 +- tools/testfiles/tvldtypes4.h5.xml | 2 +- tools/testfiles/tvldtypes5.h5.xml | 2 +- tools/testfiles/tvlstr.h5.xml | 2 +- vms/src/h5pubconf.h | 6 +- vms/src/make.com | 2 +- vms/test/check.com | 5 - vms/test/make.com | 6 - windows/copy_hdf.bat | 1 - windows/proj/hdf5/hdf5.vcproj | 42 + windows/proj/hdf5dll/hdf5dll.vcproj | 40 + windows/src/H5pubconf.h | 6 +- windows/tools/h5repack/h5repack.bat | 14 +- windows/tools/testfiles/h5difftst/h5difftst.vcproj | 12 +- windows_vnet/proj/hdf5/hdf5.vcproj | 35 + windows_vnet/proj/hdf5dll/hdf5dll.vcproj | 34 + 262 files changed, 15311 insertions(+), 11183 deletions(-) create mode 100644 src/H5Groot.c create mode 100644 tools/h5repack/testfiles/h5repack_named_dtypes.h5 diff --git a/MANIFEST b/MANIFEST index bffb300..34b8d51 100644 --- a/MANIFEST +++ b/MANIFEST @@ -583,6 +583,7 @@ ./src/H5Gpkg.h ./src/H5Gprivate.h ./src/H5Gpublic.h +./src/H5Groot.c ./src/H5Gstab.c ./src/H5Gtest.c ./src/H5Gtraverse.c @@ -1520,6 +1521,7 @@ ./tools/h5repack/testfiles/h5repack_ext.bin ./tools/h5repack/testfiles/h5repack_ext.h5 ./tools/h5repack/testfiles/ublock.bin +./tools/h5repack/testfiles/h5repack_named_dtypes.h5 # jam utility and tests diff --git a/Makefile.am b/Makefile.am index c0d6827..7acc2db 100755 --- a/Makefile.am +++ b/Makefile.am @@ -79,6 +79,9 @@ DIST_SUBDIRS = src test testpar tools . c++ fortran hl perform examples # Some files generated during configure that should be cleaned DISTCLEANFILES=config/stamp1 config/stamp2 +# Some files/directories generated during check that should be cleaned +CHECK_CLEANFILES+=*-tmp + # Define rules for lib, progs, check, and tests. # These simply involve recursing into subdirectories. test _test: check @@ -113,6 +116,7 @@ check-clean: (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ fi; \ done + $(RM) -rf prefix-tmp destdir-tmp # Some C++ compilers/linkers will create a directory named ii_files in # the root directory, which should be cleaned. @@ -150,6 +154,23 @@ installcheck-local: # check-install is just a synonym for installcheck check-install: installcheck +# check-all-install tests all installation methods. +# Install via different mechanism and then compare against the default. +# Fine if only libXXX.a files are different since they may have been ranlib'ed. +check-all-install: + @echo Installing to default location + $(MAKE) install + @echo Installing to different prefix location + $(MAKE) prefix=${ROOT}/prefix-tmp install + @echo Compare against the default installation. + @echo Fine if only libXXX.a files are different. + -diff -r prefix-tmp ${prefix} + @echo Installing to different $$\DESTDIR location + env DESTDIR=${ROOT}/destdir-tmp $(MAKE) install + @echo Compare against the default installation. + @echo Fine if only libXXX.a files are different. + -diff -r destdir-tmp${prefix} ${prefix} + # Only source files in the src directory include tracing information, # so 'make trace' only needs to recurse into that directory. trace: diff --git a/Makefile.in b/Makefile.in index 9ab76bd..6e0e40b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -350,7 +350,9 @@ 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 are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog + +# Some files/directories generated during check that should be cleaned +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *-tmp @BUILD_PARALLEL_CONDITIONAL_FALSE@TESTPARALLEL_DIR = # Define subdirectories to build. @@ -418,7 +420,7 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -rm -f libtool + -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -495,7 +497,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -853,6 +855,7 @@ check-clean: (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ fi; \ done + $(RM) -rf prefix-tmp destdir-tmp # Some C++ compilers/linkers will create a directory named ii_files in # the root directory, which should be cleaned. @@ -890,6 +893,23 @@ installcheck-local: # check-install is just a synonym for installcheck check-install: installcheck +# check-all-install tests all installation methods. +# Install via different mechanism and then compare against the default. +# Fine if only libXXX.a files are different since they may have been ranlib'ed. +check-all-install: + @echo Installing to default location + $(MAKE) install + @echo Installing to different prefix location + $(MAKE) prefix=${ROOT}/prefix-tmp install + @echo Compare against the default installation. + @echo Fine if only libXXX.a files are different. + -diff -r prefix-tmp ${prefix} + @echo Installing to different $$\DESTDIR location + env DESTDIR=${ROOT}/destdir-tmp $(MAKE) install + @echo Compare against the default installation. + @echo Fine if only libXXX.a files are different. + -diff -r destdir-tmp${prefix} ${prefix} + # Only source files in the src directory include tracing information, # so 'make trace' only needs to recurse into that directory. trace: diff --git a/README.txt b/README.txt index 4dc5078..ea29618 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.36-FA_a1 currently under development +HDF5 version 1.9.39-FA_a1 currently under development ==> README.txt <== Messages to be sent to the list should be sent to "@hdfgroup.org". diff --git a/aclocal.m4 b/aclocal.m4 index 73f8129..86d521d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.10.2 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. @@ -13,13 +13,13 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.61],, +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.61],, [m4_warning([this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -34,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], +m4_if([$1], [1.10.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -48,12 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl +[AM_AUTOMAKE_VERSION([1.10.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -303,19 +303,28 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 3 +#serial 4 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do +[# Autoconf 2.62 quotes --file arguments for eval, but not when files +# are listed without --file. Let's play safe and only enable the eval +# if we detect the quoting. +case $CONFIG_FILES in +*\'*) eval set x "$CONFIG_FILES" ;; +*) set x $CONFIG_FILES ;; +esac +shift +for mf +do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. @@ -688,13 +697,13 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -711,7 +720,7 @@ AC_DEFUN([_AM_SET_OPTION], # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- diff --git a/bin/reconfigure b/bin/reconfigure index 05e52ba..1fffa45 100755 --- a/bin/reconfigure +++ b/bin/reconfigure @@ -29,9 +29,9 @@ # HDF5 currently uses the following versions of the autotools: AUTOCONF_VERSION="autoconf (GNU Autoconf) 2.61" -AUTOMAKE_VERSION="automake (GNU automake) 1.10.1" +AUTOMAKE_VERSION="automake (GNU automake) 1.10.2" AUTOHEADER_VERSION="autoheader (GNU Autoconf) 2.61" -ACLOCAL_VERSION="aclocal (GNU automake) 1.10.1" +ACLOCAL_VERSION="aclocal (GNU automake) 1.10.2" LIBTOOL_VERSION="(GNU libtool) 2.2.6" # # When upgrading automake's version, don't forget to also update its @@ -44,13 +44,13 @@ if test -z ${AUTOCONF}; then AUTOCONF=/mnt/hdf/packages/autoconf/autoconf-2.61/bin/autoconf fi if test -z ${AUTOMAKE}; then - AUTOMAKE=/mnt/hdf/packages/automake/automake-1.10.1/bin/automake-1.10 + AUTOMAKE=/mnt/hdf/packages/automake/automake-1.10.2/bin/automake-1.10 fi if test -z ${AUTOHEADER}; then AUTOHEADER=/mnt/hdf/packages/autoconf/autoconf-2.61/bin/autoheader fi if test -z ${ACLOCAL}; then - ACLOCAL=/mnt/hdf/packages/automake/automake-1.10.1/bin/aclocal-1.10 + ACLOCAL=/mnt/hdf/packages/automake/automake-1.10.2/bin/aclocal-1.10 fi if test -z ${LIBTOOL}; then LIBTOOL=/mnt/hdf/packages/libtool/libtool-2.2.6a/bin/libtool diff --git a/c++/Makefile.in b/c++/Makefile.in index 8796ca7..1016377 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -347,8 +347,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -454,7 +454,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 63cce0a..e5749e6 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -364,8 +364,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index c90076c..a844b77 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -34,6 +34,7 @@ #include "H5DataSpace.h" #include "H5File.h" #include "H5Attribute.h" +#include "H5private.h" // for HDfree #ifndef H5_NO_NAMESPACE namespace H5 { @@ -95,23 +96,40 @@ 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 std::string to this attribute. +/// 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 +void Attribute::write(const DataType& mem_type, const H5std_string& strg) const { - // Convert string to C-string - const char* strg_C; - strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str + // Check if this attribute has variable-len string or fixed-len string and + // proceed appropriately. + htri_t is_variable_len = H5Tis_variable_str(mem_type.getId()); + if (is_variable_len < 0) + { + throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); + } + // Convert string to C-string + const char* strg_C; + strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str + herr_t ret_value = 0; - herr_t ret_value = H5Awrite( id, mem_type.getId(), &strg_C ); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::write", "H5Awrite failed"); - } + // Pass string in differently depends on variable or fixed length + if (!is_variable_len) + { + ret_value = H5Awrite(id, mem_type.getId(), strg_C); + } + else + { + // passing third argument by address + ret_value = H5Awrite(id, mem_type.getId(), &strg_C); + } + if (ret_value < 0) + { + throw AttributeIException("Attribute::write", "H5Awrite failed"); + } } //-------------------------------------------------------------------------- @@ -127,14 +145,58 @@ 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"); + throw AttributeIException("Attribute::read", "H5Aread failed"); } } //-------------------------------------------------------------------------- +// Function: Attribute::getInMemDataSize +///\brief Gets the size in memory of the attribute's data. +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +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) + { + throw AttributeIException("Attribute::getDataSize", "H5Aget_type failed"); + } + + // Get the data type's size + hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); + if (native_type < 0) + { + throw AttributeIException("Attribute::read", "H5Tget_native_type failed"); + } + size_t type_size = H5Tget_size(native_type); + if (type_size == 0) + { + throw AttributeIException("Attribute::read", "H5Tget_size failed"); + } + + // Get number of elements of the attribute + hid_t space_id = H5Aget_space(id); + if (space_id < 0) + { + throw AttributeIException("Attribute::read", "H5Aget_space failed"); + } + hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); + if (num_elements < 0) + { + throw AttributeIException("Attribute::read", "H5Sget_simple_extent_npoints failed"); + } + + // Calculate and return the size of the data + size_t data_size = type_size * num_elements; + return(data_size); +} + +//-------------------------------------------------------------------------- // Function: Attribute::read ///\brief This is an overloaded member function, provided for convenience. -/// It reads a \a std::string from this attribute. +/// 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 @@ -145,31 +207,72 @@ void Attribute::read( const DataType& mem_type, void *buf ) const // space for the buffer. Obtained the attribute size and // allocated memory properly. - BMR //-------------------------------------------------------------------------- -void Attribute::read( const DataType& mem_type, H5std_string& strg ) const +void Attribute::read(const DataType& mem_type, H5std_string& strg) const { - // Get the attribute size and allocate temporary C-string for C API - hsize_t attr_size = H5Aget_storage_size(id); - if (attr_size <= 0) - { - throw AttributeIException("Attribute::read", "Unable to get attribute size before reading"); - } - char* strg_C = new char [(size_t)attr_size+1]; - if (strg_C == NULL) - { - throw AttributeIException("Attribute::read", "Unable to allocate buffer to read the attribute"); - } - // Call C API to get the attribute data, a string of chars - herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::read", "H5Aread failed"); - } + // Check if this attribute has variable-len string or fixed-len string and + // proceed appropriately. + htri_t is_variable_len = H5Tis_variable_str(mem_type.getId()); + if (is_variable_len < 0) + { + throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); + } + + // Prepare and call C API to read attribute. + char *strg_C; + herr_t ret_value = 0; + size_t attr_size; + if (!is_variable_len) // only allocate for fixed-len string + { + // Get the size of the attribute's data + attr_size = getInMemDataSize(); + + if (attr_size > 0) + { + strg_C = new char [(size_t)attr_size+1]; + if (strg_C == NULL) + { + throw AttributeIException("Attribute::read", + "Unable to allocate buffer to read the attribute"); + } + ret_value = H5Aread(id, mem_type.getId(), strg_C); + } + else + HDstrcpy(strg_C, ""); + } + else + { + // no allocation for variable-len string; C library will + ret_value = H5Aread(id, mem_type.getId(), &strg_C); + } + if( ret_value < 0 ) + { + if (!is_variable_len) // only de-allocate for fixed-len string + delete []strg_C; + throw AttributeIException("Attribute::read", "H5Aread failed"); + } - // Get 'string' from the C char* and release resource - strg_C[attr_size] = '\0'; - strg = strg_C; - delete []strg_C; + if( ret_value < 0 ) + { + if (!is_variable_len) // only de-allocate for fixed-len string + delete []strg_C; + throw AttributeIException("Attribute::read", "H5Aread failed"); + } + + // Get string from the C char* and release resource allocated locally + if (!is_variable_len) + { + if (strg_C != "") + strg_C[attr_size] = '\0'; + strg = strg_C; + delete []strg_C; + } + // Get string from the C char* and release resource allocated by C API + else + { + strg = strg_C; + HDfree(strg_C); + } } //-------------------------------------------------------------------------- @@ -342,21 +445,21 @@ hid_t Attribute::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 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; diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 9cf91ba..00a08a5 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -40,6 +40,9 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { // Returns the amount of storage size required for this attribute. hsize_t getStorageSize() const; + // Returns the in memory size of this attribute's data. + 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; diff --git a/c++/src/Makefile.am b/c++/src/Makefile.am index 3b1ed0d..c18b990 100644 --- a/c++/src/Makefile.am +++ b/c++/src/Makefile.am @@ -19,6 +19,7 @@ # include $(top_srcdir)/config/commence.am +include $(top_srcdir)/config/lt_vers.am # Include src directory INCLUDES=-I$(top_srcdir)/src @@ -26,6 +27,9 @@ INCLUDES=-I$(top_srcdir)/src # This is our main target lib_LTLIBRARIES=libhdf5_cpp.la +# Add libtool numbers to the HDF5 C++ library (from config/lt_vers.am) +libhdf5_cpp_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + # Shared C++ libraries aren't universally supported. if CXX_SHARED_CONDITIONAL else diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 9d50223..abe8590 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -54,7 +54,8 @@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/h5c++.in \ $(top_srcdir)/config/commence.am \ - $(top_srcdir)/config/conclude.am + $(top_srcdir)/config/conclude.am \ + $(top_srcdir)/config/lt_vers.am TESTS = subdir = c++/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -83,6 +84,9 @@ am_libhdf5_cpp_la_OBJECTS = H5Exception.lo H5IdComponent.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) +libhdf5_cpp_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libhdf5_cpp_la_LDFLAGS) $(LDFLAGS) -o $@ binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src @@ -353,12 +357,21 @@ TRACE = perl $(top_srcdir)/bin/trace # *.clog are from the MPE option. CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# Add libtool shared library version numbers to the HDF5 library +# See libtool versioning documentation online. +LT_VERS_INTERFACE = 6 +LT_VERS_REVISION = 29 +LT_VERS_AGE = 0 + # Include src directory INCLUDES = -I$(top_srcdir)/src # This is our main target lib_LTLIBRARIES = libhdf5_cpp.la +# Add libtool numbers to the HDF5 C++ library (from config/lt_vers.am) +libhdf5_cpp_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + # Shared C++ libraries aren't universally supported. @CXX_SHARED_CONDITIONAL_FALSE@AM_LDFLAGS = -static bin_SCRIPTS = h5c++ @@ -408,12 +421,12 @@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -467,7 +480,7 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libhdf5_cpp.la: $(libhdf5_cpp_la_OBJECTS) $(libhdf5_cpp_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(libhdf5_cpp_la_OBJECTS) $(libhdf5_cpp_la_LIBADD) $(LIBS) + $(libhdf5_cpp_la_LINK) -rpath $(libdir) $(libhdf5_cpp_la_OBJECTS) $(libhdf5_cpp_la_LIBADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @@ -570,7 +583,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -762,6 +775,19 @@ uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \ help: @$(top_srcdir)/bin/makehelp +# 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. + # Some C++ compilers/linkers (PGI?) create a directory named "ii_files" that # holds *.ii files, which are template entity instantiations. # This entire directory should be cleaned. diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 9bbb475..0452ea0 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -382,8 +382,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -471,7 +471,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 319f894..6a5f223 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -352,7 +352,7 @@ test_tconv( H5File& file) } // test_tconv /* This message derives from H5Z */ -const H5Z_class_t H5Z_BOGUS[1] = {{ +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 */ diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 73b5a91..48a3200 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -356,7 +356,7 @@ static void test_attr_basic_read() for(i=0; i signed char conversion in the test/dt_arith test). + # There's either a bug in gcc or our code. Need further investigation. + # Turn off all optimizations to allow the tests to pass for now. + # - AKC - 2009/04/19 + PROD_CFLAGS="-O0" + ;; + gcc-3.[0-4]*|gcc-4.[012]*) # The optimization level is reduced for gcc 3.* and 4.* due to problems # with code generation for src/H5Tconv.c with the -O2 & -O3 # optimization levels (which shows up as failures for various integer @@ -153,10 +163,6 @@ case "$cc_vendor-$cc_version" in # later versions of gcc will fix this bug... - QAK - 2003/10/20 PROD_CFLAGS="-O" ;; - gcc-4*) - # Be optimistic about future versions of gcc.. :-) - QAK - 2003/10/20 - PROD_CFLAGS="-O3" - ;; *) PROD_CFLAGS="-O" ;; diff --git a/config/lt_vers.am b/config/lt_vers.am index c5af888..c460133 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 26 +LT_VERS_REVISION = 29 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 3059332..8d811bb 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 16601 2009-03-24 19:23:11Z koziol . +# From configure.in Id: configure.in 16738 2009-04-11 13:24:23Z lrknox . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for HDF5 1.9.36-FA_a1. +# Generated by GNU Autoconf 2.61 for HDF5 1.9.39-FA_a1. # # Report bugs to . # @@ -724,8 +724,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.36-FA_a1' -PACKAGE_STRING='HDF5 1.9.36-FA_a1' +PACKAGE_VERSION='1.9.39-FA_a1' +PACKAGE_STRING='HDF5 1.9.39-FA_a1' PACKAGE_BUGREPORT='help@hdfgroup.org' ac_unique_file="src/H5.c" @@ -1502,7 +1502,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.9.36-FA_a1 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.39-FA_a1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1572,7 +1572,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.36-FA_a1:";; + short | recursive ) echo "Configuration of HDF5 1.9.39-FA_a1:";; esac cat <<\_ACEOF @@ -1646,6 +1646,8 @@ Optional Features: --enable-strict-format-checks Enable strict file format checks, default=yes if debug flag is enabled, no otherwise + --enable-embedded-libinfo + Enable embedded library information [default=yes] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1754,7 +1756,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.36-FA_a1 +HDF5 configure 1.9.39-FA_a1 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1768,7 +1770,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.9.36-FA_a1, which was +It was created by HDF5 $as_me 1.9.39-FA_a1, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2463,7 +2465,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.36-FA_a1' + VERSION='1.9.39-FA_a1' cat >>confdefs.h <<_ACEOF @@ -8078,13 +8080,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:8081: $ac_compile\"" >&5) + (eval echo "\"\$as_me:8083: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:8084: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:8086: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:8087: output\"" >&5) + (eval echo "\"\$as_me:8089: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -9305,7 +9307,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 9308 "configure"' > conftest.$ac_ext + echo '#line 9310 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -12176,11 +12178,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12179: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12181: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12183: \$? = $ac_status" >&5 + echo "$as_me:12185: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12515,11 +12517,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12518: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12520: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12522: \$? = $ac_status" >&5 + echo "$as_me:12524: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12620,11 +12622,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12623: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12625: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12627: \$? = $ac_status" >&5 + echo "$as_me:12629: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12675,11 +12677,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12678: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12680: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12682: \$? = $ac_status" >&5 + echo "$as_me:12684: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15511,7 +15513,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 15514 "configure" +#line 15516 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15607,7 +15609,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 15610 "configure" +#line 15612 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17635,11 +17637,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17638: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17640: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17642: \$? = $ac_status" >&5 + echo "$as_me:17644: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17734,11 +17736,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17737: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17739: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17741: \$? = $ac_status" >&5 + echo "$as_me:17743: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17786,11 +17788,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17789: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17791: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17793: \$? = $ac_status" >&5 + echo "$as_me:17795: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19331,11 +19333,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19334: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19336: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19338: \$? = $ac_status" >&5 + echo "$as_me:19340: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -19430,11 +19432,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19433: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19435: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:19437: \$? = $ac_status" >&5 + echo "$as_me:19439: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19482,11 +19484,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19485: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19487: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:19489: \$? = $ac_status" >&5 + echo "$as_me:19491: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -51236,6 +51238,30 @@ echo "${ECHO_T}no" >&6; } esac +{ echo "$as_me:$LINENO: checking Whether to have library information embedded in the executables" >&5 +echo $ECHO_N "checking Whether to have library information embedded in the executables... $ECHO_C" >&6; } +# Check whether --enable-embedded-libinfo was given. +if test "${enable_embedded_libinfo+set}" = set; then + enableval=$enable_embedded_libinfo; enable_embedded_libinfo=$enableval +else + enable_embedded_libinfo=yes +fi + + + if test "${enable_embedded_libinfo}" = "yes"; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_EMBEDDED_LIBINFO 1 +_ACEOF + + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + + { echo "$as_me:$LINENO: checking if alignment restrictions are strictly enforced" >&5 echo $ECHO_N "checking if alignment restrictions are strictly enforced... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then @@ -51926,7 +51952,7 @@ exec 6>&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.9.36-FA_a1, which was +This file was extended by HDF5 $as_me 1.9.39-FA_a1, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -51979,7 +52005,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -HDF5 config.status 1.9.36-FA_a1 +HDF5 config.status 1.9.39-FA_a1 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -53413,7 +53439,16 @@ echo "$as_me: executing $ac_file commands" >&6;} cp libhdf5.settings.TMP src/libhdf5.settings rm -f libhdf5.settings.TMP ;; - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files +# are listed without --file. Let's play safe and only enable the eval +# if we detect the quoting. +case $CONFIG_FILES in +*\'*) eval set x "$CONFIG_FILES" ;; +*) set x $CONFIG_FILES ;; +esac +shift +for mf +do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. diff --git a/configure.in b/configure.in index 04f650b..fb43828 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.36-FA_a1], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.39-FA_a1], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) @@ -3796,6 +3796,25 @@ esac dnl ---------------------------------------------------------------------- +dnl Enable embedded library information +dnl +AC_MSG_CHECKING([Whether to have library information embedded in the executables]) +AC_ARG_ENABLE([embedded-libinfo], + [AC_HELP_STRING([--enable-embedded-libinfo], + [Enable embedded library information [default=yes]])], + [enable_embedded_libinfo=$enableval], + [enable_embedded_libinfo=yes]) + + if test "${enable_embedded_libinfo}" = "yes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_EMBEDDED_LIBINFO], [1], + [Define if library information should be embedded in the executables]) + else + AC_MSG_RESULT([no]) + fi + + +dnl ---------------------------------------------------------------------- dnl Check if pointer alignments are enforced dnl AC_MSG_CHECKING([if alignment restrictions are strictly enforced]) diff --git a/examples/Makefile.in b/examples/Makefile.in index fa4bf0e..57c7208 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -374,8 +374,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index b9678f5..adf9381 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -356,8 +356,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -463,7 +463,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 8702ab3..4baa6d4 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -375,8 +375,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90 index 3fdd6fd..9eda259 100644 --- a/fortran/src/H5Aff.f90 +++ b/fortran/src/H5Aff.f90 @@ -140,9 +140,9 @@ CONTAINS INTEGER FUNCTION h5acreate_c(loc_id, name, namelen, type_id, & space_id, acpl_id_default, aapl_id_default, attr_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ACREATE_C'::h5acreate_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ACREATE_C'::h5acreate_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -207,9 +207,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aopen_name_c(obj_id, name, namelen, attr_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_NAME_C'::h5aopen_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_NAME_C'::h5aopen_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -262,9 +262,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aopen_idx_c(obj_id, index, attr_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_IDX_C'::h5aopen_idx_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_IDX_C'::h5aopen_idx_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER, INTENT(IN) :: index INTEGER(HID_T), INTENT(OUT) :: attr_id @@ -290,9 +290,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_integer_s_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_S_C'::h5awrite_integer_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_S_C'::h5awrite_integer_s_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -320,9 +320,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_integer_1_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_1_C'::h5awrite_integer_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_1_C'::h5awrite_integer_1_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -352,9 +352,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_integer_2_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_2_C'::h5awrite_integer_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_2_C'::h5awrite_integer_2_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -382,9 +382,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_integer_3_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_3_C'::h5awrite_integer_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_3_C'::h5awrite_integer_3_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -413,9 +413,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_integer_4_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_4_C'::h5awrite_integer_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_4_C'::h5awrite_integer_4_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -443,9 +443,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_integer_5_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_5_C'::h5awrite_integer_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_5_C'::h5awrite_integer_5_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -474,9 +474,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_integer_6_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_6_C'::h5awrite_integer_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_6_C'::h5awrite_integer_6_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -506,9 +506,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_integer_7_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_7_C'::h5awrite_integer_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_7_C'::h5awrite_integer_7_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -536,9 +536,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_real_s_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_S_C'::h5awrite_real_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_S_C'::h5awrite_real_s_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -566,9 +566,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_real_1_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_1_C'::h5awrite_real_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_1_C'::h5awrite_real_1_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -598,9 +598,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_real_2_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_2_C'::h5awrite_real_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_2_C'::h5awrite_real_2_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -630,9 +630,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_real_3_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_3_C'::h5awrite_real_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_3_C'::h5awrite_real_3_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -662,9 +662,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_real_4_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_4_C'::h5awrite_real_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_4_C'::h5awrite_real_4_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -694,9 +694,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_real_5_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_5_C'::h5awrite_real_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_5_C'::h5awrite_real_5_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -726,9 +726,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_real_6_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_6_C'::h5awrite_real_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_6_C'::h5awrite_real_6_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -758,9 +758,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_real_7_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_7_C'::h5awrite_real_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_7_C'::h5awrite_real_7_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -788,9 +788,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awritec_s_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_S_C'::h5awritec_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_S_C'::h5awritec_s_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: attr_id @@ -818,9 +818,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awritec_1_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_1_C'::h5awritec_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_1_C'::h5awritec_1_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -850,9 +850,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awritec_2_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_2_C'::h5awritec_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_2_C'::h5awritec_2_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: attr_id @@ -882,9 +882,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awritec_3_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_3_C'::h5awritec_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_3_C'::h5awritec_3_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -914,9 +914,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awritec_4_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_4_C'::h5awritec_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_4_C'::h5awritec_4_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -946,9 +946,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awritec_5_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_5_C'::h5awritec_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_5_C'::h5awritec_5_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -978,9 +978,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awritec_6_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_6_C'::h5awritec_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_6_C'::h5awritec_6_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1010,9 +1010,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awritec_7_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_7_C'::h5awritec_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_7_C'::h5awritec_7_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1078,9 +1078,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_integer_s_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_S_C'::h5aread_integer_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_S_C'::h5aread_integer_s_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1105,9 +1105,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_integer_1_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_1_C'::h5aread_integer_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_1_C'::h5aread_integer_1_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1134,9 +1134,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_integer_2_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_2_C'::h5aread_integer_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_2_C'::h5aread_integer_2_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1164,9 +1164,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_integer_3_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_3_C'::h5aread_integer_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_3_C'::h5aread_integer_3_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1196,9 +1196,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_integer_4_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_4_C'::h5aread_integer_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_4_C'::h5aread_integer_4_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1228,9 +1228,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_integer_5_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_5_C'::h5aread_integer_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_5_C'::h5aread_integer_5_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1260,9 +1260,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_integer_6_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_6_C'::h5aread_integer_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_6_C'::h5aread_integer_6_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1292,9 +1292,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_integer_7_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_7_C'::h5aread_integer_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_7_C'::h5aread_integer_7_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1322,9 +1322,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_real_s_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_S_C'::h5aread_real_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_S_C'::h5aread_real_s_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1352,9 +1352,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_real_1_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_1_C'::h5aread_real_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_1_C'::h5aread_real_1_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1384,9 +1384,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_real_2_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_2_C'::h5aread_real_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_2_C'::h5aread_real_2_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1416,9 +1416,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_real_3_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_3_C'::h5aread_real_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_3_C'::h5aread_real_3_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1448,9 +1448,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_real_4_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_4_C'::h5aread_real_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_4_C'::h5aread_real_4_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1480,9 +1480,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_real_5_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_5_C'::h5aread_real_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_5_C'::h5aread_real_5_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1512,9 +1512,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_real_6_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_6_C'::h5aread_real_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_6_C'::h5aread_real_6_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1544,9 +1544,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_real_7_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_7_C'::h5aread_real_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_7_C'::h5aread_real_7_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1574,9 +1574,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5areadc_s_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREADC_S_C'::h5areadc_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_S_C'::h5areadc_s_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1605,9 +1605,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5areadc_1_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREADC_1_C'::h5areadc_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_1_C'::h5areadc_1_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1638,9 +1638,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5areadc_2_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREADC_2_C'::h5areadc_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_2_C'::h5areadc_2_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1671,9 +1671,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5areadc_3_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREADC_3_C'::h5areadc_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_3_C'::h5areadc_3_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1704,9 +1704,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5areadc_4_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREADC_4_C'::h5areadc_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_4_C'::h5areadc_4_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1737,9 +1737,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5areadc_5_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREADC_5_C'::h5areadc_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_5_C'::h5areadc_5_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1770,9 +1770,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5areadc_6_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREADC_6_C'::h5areadc_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_6_C'::h5areadc_6_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1803,9 +1803,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5areadc_7_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREADC_7_C'::h5areadc_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_7_C'::h5areadc_7_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id @@ -1856,9 +1856,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aget_space_c(attr_id, space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_SPACE_C'::h5aget_space_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_SPACE_C'::h5aget_space_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(OUT) :: space_id END FUNCTION h5aget_space_c @@ -1904,9 +1904,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aget_type_c(attr_id, type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_TYPE_C'::h5aget_type_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_TYPE_C'::h5aget_type_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(OUT) :: type_id END FUNCTION h5aget_type_c @@ -1956,9 +1956,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aget_name_c(attr_id, size, buf) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_C'::h5aget_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_C'::h5aget_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(SIZE_T), INTENT(IN) :: size @@ -2049,10 +2049,10 @@ CONTAINS INTEGER FUNCTION h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, & n, name, size_default, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_BY_IDX_C'::h5aget_name_by_idx_c - !DEC$ ENDIF - !DEC$ ATTRIBUTES reference :: obj_name, name + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_BY_IDX_C'::h5aget_name_by_idx_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: obj_name, name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER, INTENT(IN) :: idx_type @@ -2119,9 +2119,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aget_num_attrs_c(obj_id, attr_num) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NUM_ATTRS_C'::h5aget_num_attrs_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_NUM_ATTRS_C'::h5aget_num_attrs_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER, INTENT(OUT) :: attr_num END FUNCTION h5aget_num_attrs_c @@ -2169,9 +2169,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5adelete_c(obj_id, name, namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_C'::h5adelete_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_C'::h5adelete_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -2218,9 +2218,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aclose_c(attr_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ACLOSE_C'::h5aclose_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ACLOSE_C'::h5aclose_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: attr_id END FUNCTION h5aclose_c END INTERFACE @@ -2261,9 +2261,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aget_storage_size_c(attr_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_STORAGE_SIZE_C'::h5aget_storage_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_STORAGE_SIZE_C'::h5aget_storage_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5aget_storage_size_c @@ -2306,9 +2306,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aget_create_plist_c(attr_id, creation_prop_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_CREATE_PLIST_C'::h5aget_create_plist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_CREATE_PLIST_C'::h5aget_create_plist_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(OUT) :: creation_prop_id END FUNCTION h5aget_create_plist_c @@ -2367,9 +2367,9 @@ CONTAINS old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ARENAME_BY_NAME_C'::h5arename_by_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ARENAME_BY_NAME_C'::h5arename_by_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: obj_name, old_attr_name, new_attr_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name @@ -2438,9 +2438,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_C'::h5aopen_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_C'::h5aopen_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: attr_name INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(IN) :: attr_name @@ -2527,9 +2527,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_BY_IDX_C'::h5adelete_by_idx_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_BY_IDX_C'::h5adelete_by_idx_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: obj_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name @@ -2591,9 +2591,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_BY_NAME_C'::h5adelete_by_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_BY_NAME_C'::h5adelete_by_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: obj_name, attr_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name @@ -2674,10 +2674,10 @@ CONTAINS INTEGER FUNCTION h5aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & aapl_id_default, lapl_id_default, attr_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_BY_IDX_C'::h5aopen_by_idx_c - !DEC$ ENDIF - !DEC$ ATTRIBUTES reference :: obj_name + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_BY_IDX_C'::h5aopen_by_idx_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: obj_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER, INTENT(IN) :: idx_type @@ -2748,9 +2748,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aget_info_c(attr_id, corder_valid, corder, cset, data_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_C'::h5aget_info_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_C'::h5aget_info_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER, INTENT(OUT) :: corder_valid @@ -2834,10 +2834,10 @@ CONTAINS INTEGER FUNCTION h5aget_info_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default, & corder_valid, corder, cset, data_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_BY_IDX_C'::h5aget_info_by_idx_c - !DEC$ ENDIF - !DEC$ ATTRIBUTES reference :: obj_name + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_BY_IDX_C'::h5aget_info_by_idx_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: obj_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER, INTENT(IN) :: idx_type @@ -2920,10 +2920,10 @@ CONTAINS INTEGER FUNCTION h5aget_info_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, & corder_valid, corder, cset, data_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_BY_NAME_C'::h5aget_info_by_name_c - !DEC$ ENDIF - !DEC$ ATTRIBUTES reference :: obj_name, attr_name + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_BY_NAME_C'::h5aget_info_by_name_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: obj_name, attr_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER(SIZE_T), INTENT(IN) :: obj_namelen @@ -3011,10 +3011,10 @@ CONTAINS INTEGER FUNCTION h5acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ACREATE_BY_NAME_C'::h5acreate_by_name_c - !DEC$ ENDIF - !DEC$ ATTRIBUTES reference :: obj_name, attr_name + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ACREATE_BY_NAME_C'::h5acreate_by_name_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: obj_name, attr_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER(SIZE_T), INTENT(IN) :: obj_namelen @@ -3083,10 +3083,10 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AEXISTS_C'::h5aexists_c - !DEC$ ENDIF - !DEC$ ATTRIBUTES reference :: attr_name + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AEXISTS_C'::h5aexists_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: attr_name INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(IN) :: attr_name INTEGER(SIZE_T) :: attr_namelen @@ -3148,10 +3148,10 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, attr_exists_c) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AEXISTS_BY_NAME_C'::h5aexists_by_name_c - !DEC$ ENDIF - !DEC$ ATTRIBUTES reference :: obj_name, attr_name + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AEXISTS_BY_NAME_C'::h5aexists_by_name_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: obj_name, attr_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER(SIZE_T), INTENT(IN) :: obj_namelen @@ -3224,10 +3224,10 @@ CONTAINS INTEGER FUNCTION h5aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & aapl_id_default, lapl_id_default, attr_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_BY_NAME_C'::h5aopen_by_name_c - !DEC$ ENDIF - !DEC$ ATTRIBUTES reference :: obj_name, attr_name + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_BY_NAME_C'::h5aopen_by_name_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: obj_name, attr_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER(SIZE_T), INTENT(IN) :: obj_namelen @@ -3290,9 +3290,9 @@ CONTAINS INTEGER FUNCTION h5arename_c(loc_id, & old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ARENAME_C'::h5arename_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ARENAME_C'::h5arename_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: old_attr_name, new_attr_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: old_attr_name diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 58f3ce2..a7c6e75 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1992,4 +1992,32 @@ nh5dcreate_anon_c (hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, return ret_value; } +/*---------------------------------------------------------------------------- + * Name: h5dget_access_plist_c + * Purpose: Call H5Dget_access_plist + * Inputs: + * dset_id - dataset identifier + * Outputs: + * plist_id - the dataset access property list identifier. + * + * Returns: 0 on success, -1 on failure + * Programmer: M.S. Breitenfeld + * April 13, 2009 + *---------------------------------------------------------------------------*/ +int_f +nh5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id) +{ + int ret_value = -1; + /* + * Call H5Dget_access_plist function. + */ + if((*plist_id = (hid_t_f)H5Dget_access_plist((hid_t)*dset_id)) < 0) + goto DONE; + + ret_value = 0; + + DONE: + return ret_value; +} + diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 index b9b9f7b..f06f5a5 100644 --- a/fortran/src/H5Dff.f90 +++ b/fortran/src/H5Dff.f90 @@ -164,9 +164,9 @@ CONTAINS INTEGER FUNCTION h5dcreate_c(loc_id, name, namelen, type_id, & space_id, lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_C'::h5dcreate_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_C'::h5dcreate_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -220,7 +220,7 @@ CONTAINS ! port). February 28, 2001 ! ! -Added 1.8 (optional) parameter dapl_id -! February, 2008, M.S. Breitenfeld +! February, 2008, M. Scot Breitenfeld ! ! Comment: !---------------------------------------------------------------------- @@ -242,9 +242,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DOPEN_C'::h5dopen_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DOPEN_C'::h5dopen_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -297,9 +297,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dclose_c(dset_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DCLOSE_C'::h5dclose_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DCLOSE_C'::h5dclose_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id END FUNCTION h5dclose_c END INTERFACE @@ -337,9 +337,9 @@ CONTAINS mem_space_id_default, & file_space_id_default, xfer_prp_default, ref_buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REF_OBJ_C'::h5dwrite_ref_obj_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REF_OBJ_C'::h5dwrite_ref_obj_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: xfer_prp_default @@ -402,9 +402,9 @@ CONTAINS mem_space_id_default, & file_space_id_default, xfer_prp_default, ref_buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REF_REG_C'::h5dwrite_ref_reg_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REF_REG_C'::h5dwrite_ref_reg_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: xfer_prp_default @@ -470,9 +470,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_S_C'::h5dwrite_integer_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_S_C'::h5dwrite_integer_s_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -526,9 +526,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_1_C'::h5dwrite_integer_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_1_C'::h5dwrite_integer_1_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -583,9 +583,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_2_C'::h5dwrite_integer_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_2_C'::h5dwrite_integer_2_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -640,9 +640,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_3_C'::h5dwrite_integer_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_3_C'::h5dwrite_integer_3_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -698,9 +698,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_4_C'::h5dwrite_integer_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_4_C'::h5dwrite_integer_4_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -755,9 +755,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_5_C'::h5dwrite_integer_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_5_C'::h5dwrite_integer_5_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -814,9 +814,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_6_C'::h5dwrite_integer_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_6_C'::h5dwrite_integer_6_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -872,9 +872,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_7_C'::h5dwrite_integer_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_7_C'::h5dwrite_integer_7_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -929,9 +929,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_S_C'::h5dwritec_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_S_C'::h5dwritec_s_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -986,9 +986,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_1_C'::h5dwritec_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_1_C'::h5dwritec_1_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1044,9 +1044,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_2_C'::h5dwritec_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_2_C'::h5dwritec_2_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1102,9 +1102,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_3_C'::h5dwritec_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_3_C'::h5dwritec_3_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1160,9 +1160,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_4_C'::h5dwritec_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_4_C'::h5dwritec_4_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1218,9 +1218,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_5_C'::h5dwritec_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_5_C'::h5dwritec_5_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1276,9 +1276,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_6_C'::h5dwritec_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_6_C'::h5dwritec_6_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1334,9 +1334,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_7_C'::h5dwritec_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_7_C'::h5dwritec_7_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1389,9 +1389,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_S_C'::h5dwrite_real_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_S_C'::h5dwrite_real_s_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1444,9 +1444,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_1_C'::h5dwrite_real_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_1_C'::h5dwrite_real_1_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1501,9 +1501,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_2_C'::h5dwrite_real_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_2_C'::h5dwrite_real_2_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1557,9 +1557,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_3_C'::h5dwrite_real_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_3_C'::h5dwrite_real_3_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1613,9 +1613,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_4_C'::h5dwrite_real_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_4_C'::h5dwrite_real_4_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1669,9 +1669,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_5_C'::h5dwrite_real_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_5_C'::h5dwrite_real_5_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1725,9 +1725,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_6_C'::h5dwrite_real_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_6_C'::h5dwrite_real_6_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1781,9 +1781,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_7_C'::h5dwrite_real_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_7_C'::h5dwrite_real_7_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1878,9 +1878,9 @@ CONTAINS mem_space_id_default, & file_space_id_default, xfer_prp_default, ref_buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REF_OBJ_C'::h5dread_ref_obj_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REF_OBJ_C'::h5dread_ref_obj_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: xfer_prp_default @@ -1943,9 +1943,9 @@ CONTAINS mem_space_id_default, & file_space_id_default, xfer_prp_default, ref_buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REF_REG_C'::h5dread_ref_reg_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REF_REG_C'::h5dread_ref_reg_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: xfer_prp_default @@ -2010,9 +2010,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_S_C'::h5dread_integer_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_S_C'::h5dread_integer_s_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2066,9 +2066,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_1_C'::h5dread_integer_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_1_C'::h5dread_integer_1_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2123,9 +2123,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_2_C'::h5dread_integer_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_2_C'::h5dread_integer_2_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2181,9 +2181,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_3_C'::h5dread_integer_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_3_C'::h5dread_integer_3_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2239,9 +2239,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_4_C'::h5dread_integer_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_4_C'::h5dread_integer_4_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2297,9 +2297,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_5_C'::h5dread_integer_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_5_C'::h5dread_integer_5_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2355,9 +2355,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_6_C'::h5dread_integer_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_6_C'::h5dread_integer_6_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2413,9 +2413,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_7_C'::h5dread_integer_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_7_C'::h5dread_integer_7_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2469,9 +2469,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREADC_S_C'::h5dreadc_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_S_C'::h5dreadc_s_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -2526,9 +2526,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREADC_1_C'::h5dreadc_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_1_C'::h5dreadc_1_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -2584,9 +2584,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREADC_2_C'::h5dreadc_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_2_C'::h5dreadc_2_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -2642,9 +2642,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREADC_3_C'::h5dreadc_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_3_C'::h5dreadc_3_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -2700,9 +2700,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREADC_4_C'::h5dreadc_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_4_C'::h5dreadc_4_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -2758,9 +2758,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREADC_5_C'::h5dreadc_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_5_C'::h5dreadc_5_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -2816,9 +2816,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREADC_6_C'::h5dreadc_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_6_C'::h5dreadc_6_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -2874,9 +2874,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREADC_7_C'::h5dreadc_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_7_C'::h5dreadc_7_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -2929,9 +2929,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_S_C'::h5dread_real_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_S_C'::h5dread_real_s_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -2984,9 +2984,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_1_C'::h5dread_real_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_1_C'::h5dread_real_1_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3040,9 +3040,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_2_C'::h5dread_real_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_2_C'::h5dread_real_2_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3096,9 +3096,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_3_C'::h5dread_real_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_3_C'::h5dread_real_3_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3152,9 +3152,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_4_C'::h5dread_real_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_4_C'::h5dread_real_4_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3208,9 +3208,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_5_C'::h5dread_real_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_5_C'::h5dread_real_5_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3264,9 +3264,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_6_C'::h5dread_real_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_6_C'::h5dread_real_6_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3321,9 +3321,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_7_C'::h5dread_real_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_7_C'::h5dread_real_7_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3385,9 +3385,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dget_space_c(dataset_id, dataspace_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DGET_SPACE_C'::h5dget_space_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_SPACE_C'::h5dget_space_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dataset_id INTEGER(HID_T), INTENT(OUT) :: dataspace_id END FUNCTION h5dget_space_c @@ -3433,9 +3433,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dget_type_c (dataset_id, datatype_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DGET_TYPE_C'::h5dget_type_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_TYPE_C'::h5dget_type_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dataset_id INTEGER(HID_T), INTENT(OUT) :: datatype_id END FUNCTION h5dget_type_c @@ -3489,9 +3489,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dset_extent_c(dataset_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DSET_EXTENT_C'::h5dset_extent_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSET_EXTENT_C'::h5dset_extent_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dataset_id INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size END FUNCTION h5dset_extent_c @@ -3541,9 +3541,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dget_create_plist_c(dataset_id, plist_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DGET_CREATE_PLIST_C'::h5dget_create_plist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_CREATE_PLIST_C'::h5dget_create_plist_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dataset_id INTEGER(HID_T), INTENT(OUT) :: plist_id END FUNCTION h5dget_create_plist_c @@ -3587,9 +3587,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dget_storage_size_c(dataset_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DGET_STORAGE_SIZE_C'::h5dget_storage_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_STORAGE_SIZE_C'::h5dget_storage_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dataset_id INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5dget_storage_size_c @@ -3635,9 +3635,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DVLEN_GET_MAX_LEN_C'::h5dvlen_get_max_len_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DVLEN_GET_MAX_LEN_C'::h5dvlen_get_max_len_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dataset_id INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(HID_T), INTENT(IN) :: space_id @@ -3678,9 +3678,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims, len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_INTEGER_C'::h5dwrite_vl_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_INTEGER_C'::h5dwrite_vl_integer_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3741,9 +3741,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims, len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_INTEGER_C'::h5dread_vl_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_INTEGER_C'::h5dread_vl_integer_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3801,9 +3801,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims, len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_REAL_C'::h5dwrite_vl_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_REAL_C'::h5dwrite_vl_real_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3864,9 +3864,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims, len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_REAL_C'::h5dread_vl_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_REAL_C'::h5dread_vl_real_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -3926,9 +3926,9 @@ CONTAINS ! xfer_prp_default, tmp_buf, dims, str_len) xfer_prp_default, buf, dims, str_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_STRING_C'::h5dwrite_vl_string_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_STRING_C'::h5dwrite_vl_string_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -3998,9 +3998,9 @@ CONTAINS ! xfer_prp_default, tmp_buf, dims, str_len) xfer_prp_default, buf, dims, str_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_STRING_C'::h5dread_vl_string_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_STRING_C'::h5dread_vl_string_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -4078,9 +4078,9 @@ CONTAINS INTEGER FUNCTION h5dfill_integer_c(fill_value, fill_type_id, space_id, & buf, mem_type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DFILL_INTEGER_C'::h5dfill_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILL_INTEGER_C'::h5dfill_integer_c + !DEC$ENDIF INTEGER, INTENT(IN) :: fill_value ! Fill value INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier @@ -4137,9 +4137,9 @@ CONTAINS INTEGER FUNCTION h5dfill_real_c(fill_valuer, fill_type_id, space_id, & buf, mem_type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DFILL_REAL_C'::h5dfill_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILL_REAL_C'::h5dfill_real_c + !DEC$ENDIF REAL, INTENT(IN) :: fill_valuer ! Fill value INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier @@ -4195,9 +4195,9 @@ CONTAINS INTEGER FUNCTION h5dfillc_c(fill_value, fill_type_id, space_id, & buf, mem_type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DFILLC_C'::h5dfillc_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILLC_C'::h5dfillc_c + !DEC$ENDIF CHARACTER, INTENT(IN) :: fill_value ! Fill value INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier @@ -4247,9 +4247,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dget_space_status_c(dset_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DGET_SPACE_STATUS_C'::h5dget_space_status_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_SPACE_STATUS_C'::h5dget_space_status_c + !DEC$ENDIF INTEGER(HID_T) :: dset_id INTEGER :: flag END FUNCTION h5dget_space_status_c @@ -4276,7 +4276,7 @@ CONTAINS ! dcpl_id - Dataset creation property list identifier. ! dapl_id - Dataset access property list identifier. ! -! Programmer: M.S. Breitenfeld +! Programmer: M. Scot Breitenfeld ! February 11, 2008 ! ! Modifications: @@ -4303,9 +4303,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_ANON_C'::h5dcreate_anon_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_ANON_C'::h5dcreate_anon_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: loc_id INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(HID_T), INTENT(IN) :: space_id @@ -4325,6 +4325,48 @@ CONTAINS END SUBROUTINE h5dcreate_anon_f +!---------------------------------------------------------------------- +! Name: h5dget_access_plist_f +! +! Purpose: Returns a copy of the dataset creation property list. +! +! Inputs: +! dset_id - dataset identifier. +! Outputs: +! plist_id - the dataset access property list identifier. +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! April 13, 2009 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5dget_access_plist_f(dset_id, plist_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(OUT) :: plist_id + INTEGER, INTENT(OUT) :: hdferr ! Error code. + + INTERFACE + INTEGER FUNCTION h5dget_access_plist_c(dset_id, plist_id) + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_ACCESS_PLIST_C'::h5dget_access_plist_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(OUT) :: plist_id + END FUNCTION h5dget_access_plist_c + END INTERFACE + + hdferr = h5dget_access_plist_c(dset_id, plist_id) + + END SUBROUTINE h5dget_access_plist_f + END MODULE H5D diff --git a/fortran/src/H5Eff.f90 b/fortran/src/H5Eff.f90 index c7870fe..b385f39 100644 --- a/fortran/src/H5Eff.f90 +++ b/fortran/src/H5Eff.f90 @@ -77,9 +77,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5eclear_c() USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ECLEAR_C'::h5eclear_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ECLEAR_C'::h5eclear_c + !DEC$ENDIF END FUNCTION h5eclear_c END INTERFACE hdferr = h5eclear_c() @@ -117,9 +117,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5eprint_c1(name, namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5EPRINT_C1'::h5eprint_c1 - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5EPRINT_C1'::h5eprint_c1 + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER :: namelen CHARACTER(LEN=*),INTENT(IN) :: name @@ -129,9 +129,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5eprint_c2() USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5EPRINT_C2'::h5eprint_c2 - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5EPRINT_C2'::h5eprint_c2 + !DEC$ENDIF END FUNCTION h5eprint_c2 END INTERFACE namelen = LEN(NAME) @@ -178,9 +178,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5eget_major_c(error_no, name, namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5EGET_MAJOR_C'::h5eget_major_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5EGET_MAJOR_C'::h5eget_major_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER :: error_no CHARACTER(LEN=*) :: name @@ -228,9 +228,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5eget_minor_c(error_no, name) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5EGET_MINOR_C'::h5eget_minor_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5EGET_MINOR_C'::h5eget_minor_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER :: error_no CHARACTER(LEN=*) :: name @@ -279,9 +279,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5eset_auto_c(printflag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ESET_AUTO_C'::h5eset_auto_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ESET_AUTO_C'::h5eset_auto_c + !DEC$ENDIF INTEGER :: printflag END FUNCTION h5eset_auto_c END INTERFACE diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 index 86d9c0e..5d76865 100644 --- a/fortran/src/H5Fff.f90 +++ b/fortran/src/H5Fff.f90 @@ -73,9 +73,9 @@ INTEGER FUNCTION h5fcreate_c(name, namelen, access_flags, & creation_prp_default, access_prp_default, file_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FCREATE_C':: h5fcreate_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FCREATE_C':: h5fcreate_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name CHARACTER(LEN=*), INTENT(IN) :: name INTEGER, INTENT(IN) :: access_flags @@ -152,9 +152,9 @@ INTERFACE INTEGER FUNCTION h5fflush_c(object_id, scope) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FFLUSH_C':: h5fflush_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FFLUSH_C':: h5fflush_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: object_id INTEGER, INTENT(IN) :: scope END FUNCTION h5fflush_c @@ -213,9 +213,9 @@ INTEGER FUNCTION h5fmount_c(loc_id, name, namelen, & child_id, access_prp_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FMOUNT_C':: h5fmount_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FMOUNT_C':: h5fmount_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -274,9 +274,9 @@ INTERFACE INTEGER FUNCTION h5funmount_c(loc_id, name, namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FUNMOUNT_C':: h5funmount_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FUNMOUNT_C':: h5funmount_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -336,9 +336,9 @@ INTEGER FUNCTION h5fopen_c(name, namelen, access_flags, & access_prp_default, file_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FOPEN_C':: h5fopen_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FOPEN_C':: h5fopen_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name CHARACTER(LEN=*), INTENT(IN) :: name INTEGER :: namelen @@ -394,9 +394,9 @@ INTERFACE INTEGER FUNCTION h5freopen_c(file_id, ret_file_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FREOPEN_C':: h5freopen_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FREOPEN_C':: h5freopen_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HID_T), INTENT(OUT) :: ret_file_id END FUNCTION h5freopen_c @@ -445,9 +445,9 @@ INTERFACE INTEGER FUNCTION h5fget_create_plist_c(file_id, prop_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FGET_CREATE_PLIST_C':: h5fget_create_plist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) +!DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_CREATE_PLIST_C':: h5fget_create_plist_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HID_T), INTENT(OUT) :: prop_id END FUNCTION h5fget_create_plist_c @@ -496,9 +496,9 @@ INTERFACE INTEGER FUNCTION h5fget_access_plist_c(file_id, access_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FGET_CREATE_PLIST_C':: h5fget_access_plist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) +!DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_CREATE_PLIST_C':: h5fget_access_plist_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HID_T), INTENT(OUT) :: access_id END FUNCTION h5fget_access_plist_c @@ -550,9 +550,9 @@ INTERFACE INTEGER FUNCTION h5fis_hdf5_c(name, namelen, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FIS_HDF5_C':: h5fis_hdf5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FIS_HDF5_C':: h5fis_hdf5_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name CHARACTER(LEN=*), INTENT(IN) :: name INTEGER :: namelen @@ -602,9 +602,9 @@ INTERFACE INTEGER FUNCTION h5fclose_c(file_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FCLOSE_C':: h5fclose_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FCLOSE_C':: h5fclose_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: file_id END FUNCTION h5fclose_c END INTERFACE @@ -654,9 +654,9 @@ INTERFACE INTEGER FUNCTION h5fget_obj_count_c(file_id, obj_type, obj_count) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FGET_OBJ_COUNT_C':: h5fget_obj_count_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_OBJ_COUNT_C':: h5fget_obj_count_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: file_id INTEGER, INTENT(IN) :: obj_type ! Object type INTEGER(SIZE_T), INTENT(OUT) :: obj_count @@ -716,9 +716,9 @@ INTERFACE INTEGER FUNCTION h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FGET_OBJ_IDS_C':: h5fget_obj_ids_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_OBJ_IDS_C':: h5fget_obj_ids_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: file_id INTEGER, INTENT(IN) :: obj_type INTEGER(SIZE_T), INTENT(IN) :: max_objs @@ -765,9 +765,9 @@ INTERFACE INTEGER FUNCTION h5fget_freespace_c(file_id, free_space) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FGET_FREESPACE_C':: h5fget_freespace_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_FREESPACE_C':: h5fget_freespace_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HSSIZE_T), INTENT(OUT) :: free_space END FUNCTION h5fget_freespace_c @@ -814,9 +814,9 @@ INTERFACE INTEGER FUNCTION h5fget_name_c(obj_id, size, buf, buflen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FGET_NAME_C'::h5fget_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_NAME_C'::h5fget_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER(SIZE_T), INTENT(OUT) :: size @@ -860,9 +860,9 @@ INTERFACE INTEGER FUNCTION h5fget_filesize_c(file_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5FGET_FILESIZE_C'::h5fget_filesize_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_FILESIZE_C'::h5fget_filesize_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5fget_filesize_c diff --git a/fortran/src/H5Gff.f90 b/fortran/src/H5Gff.f90 index d393a83..ae120bb 100644 --- a/fortran/src/H5Gff.f90 +++ b/fortran/src/H5Gff.f90 @@ -94,9 +94,9 @@ CONTAINS INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & size_hint_default, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -178,9 +178,9 @@ CONTAINS !!$ INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & !!$ OBJECT_NAMELEN_DEFAULT, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) !!$ USE H5GLOBAL -!!$ !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c -!!$ !DEC$ ENDIF +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c +!!$ !DEC$ENDIF !!$ !DEC$ATTRIBUTES reference :: name !!$ INTEGER(HID_T), INTENT(IN) :: loc_id !!$ CHARACTER(LEN=*), INTENT(IN) :: name @@ -255,9 +255,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GOPEN_C'::h5gopen_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GOPEN_C'::h5gopen_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -309,9 +309,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gclose_c(grp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GCLOSE_C'::h5gclose_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCLOSE_C'::h5gclose_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: grp_id END FUNCTION h5gclose_c END INTERFACE @@ -370,9 +370,9 @@ CONTAINS namelen, idx, & obj_name, obj_namelen, obj_type) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_OBJ_INFO_IDX_C'::h5gget_obj_info_idx_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_OBJ_INFO_IDX_C'::h5gget_obj_info_idx_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name !DEC$ATTRIBUTES reference :: obj_name INTEGER(HID_T), INTENT(IN) :: loc_id @@ -434,9 +434,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gn_members_c(loc_id, name, namelen, nmembers) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GN_MEMBERS_C'::h5gn_members_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GN_MEMBERS_C'::h5gn_members_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -507,9 +507,9 @@ CONTAINS current_namelen, new_name, new_namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GLINK_C'::h5glink_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GLINK_C'::h5glink_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: current_name !DEC$ATTRIBUTES reference :: new_name INTEGER(HID_T), INTENT(IN) :: loc_id @@ -581,9 +581,9 @@ CONTAINS new_name, new_namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GLINK2_C'::h5glink2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GLINK2_C'::h5glink2_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: cur_name !DEC$ATTRIBUTES reference :: new_name INTEGER(HID_T), INTENT(IN) :: cur_loc_id @@ -643,9 +643,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gunlink_c(loc_id, name, namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GUNLINK_C'::h5gunlink_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GUNLINK_C'::h5gunlink_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -700,9 +700,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gmove_c(loc_id, name, namelen, new_name, new_namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GMOVE_C'::h5gmove_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GMOVE_C'::h5gmove_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name !DEC$ATTRIBUTES reference :: new_name INTEGER(HID_T), INTENT(IN) :: loc_id @@ -760,9 +760,9 @@ CONTAINS INTEGER FUNCTION h5gmove2_c(src_loc_id, src_name, src_namelen, & dst_loc_id, dst_name, dst_namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GMOVE2_C'::h5gmove2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GMOVE2_C'::h5gmove2_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: src_name !DEC$ATTRIBUTES reference :: dst_name INTEGER(HID_T), INTENT(IN) :: src_loc_id @@ -829,9 +829,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gget_linkval_c(loc_id, name, namelen, size, buffer) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_LINKVAL_C'::h5gget_linkval_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_LINKVAL_C'::h5gget_linkval_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name !DEC$ATTRIBUTES reference :: buffer INTEGER(HID_T), INTENT(IN) :: loc_id @@ -889,9 +889,9 @@ CONTAINS INTEGER FUNCTION h5gset_comment_c(loc_id, name, namelen, & comment, commentlen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GSET_COMMENT_C'::h5gset_comment_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GSET_COMMENT_C'::h5gset_comment_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name !DEC$ATTRIBUTES reference :: comment INTEGER(HID_T), INTENT(IN) :: loc_id @@ -952,9 +952,9 @@ CONTAINS INTEGER FUNCTION h5gget_comment_c(loc_id, name, namelen, & size, buffer) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_COMMENT_C'::h5gget_comment_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_COMMENT_C'::h5gget_comment_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name, buffer INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -1005,9 +1005,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gcreate_anon_c(loc_id, gcpl_id_default, gapl_id_default, grp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_ANON_C'::h5gcreate_anon_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_ANON_C'::h5gcreate_anon_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier INTEGER(HID_T), INTENT(IN) :: gcpl_id_default ! Property list for group creation INTEGER(HID_T), INTENT(IN) :: gapl_id_default ! Property list for group access @@ -1057,9 +1057,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gget_create_plist_c(grp_id, gcpl_id ) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_CREATE_PLIST_C'::h5gget_create_plist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_CREATE_PLIST_C'::h5gget_create_plist_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: grp_id INTEGER(HID_T), INTENT(OUT) :: gcpl_id END FUNCTION h5gget_create_plist_c @@ -1122,9 +1122,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_C'::h5gget_info_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_C'::h5gget_info_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: group_id INTEGER, INTENT(OUT) :: storage_type INTEGER, INTENT(OUT) :: nlinks @@ -1212,9 +1212,9 @@ CONTAINS INTEGER FUNCTION h5gget_info_by_idx_c(loc_id, group_name, group_name_len, index_type, order, n, lapl_id_default, & storage_type, nlinks, max_corder, mounted_c) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_IDX_C'::h5gget_info_by_idx_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_IDX_C'::h5gget_info_by_idx_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: group_name INTEGER(HID_T), INTENT(IN) :: loc_id @@ -1312,9 +1312,9 @@ CONTAINS INTEGER FUNCTION h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & storage_type, nlinks, max_corder, mounted_c) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_NAME_C'::h5gget_info_by_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_NAME_C'::h5gget_info_by_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: group_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: group_name diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index 5368861..e8b54f0 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -211,3 +211,33 @@ nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id) done: return ret_value; } + +/*---------------------------------------------------------------------------- + * Name: h5iis_valid_c + * Purpose: Calls H5Iis_valid + * Inputs: obj_id - object identifier + * Outputs: 0 = false, 1 = true + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Tuesday, August 24, 2004 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5iis_valid_c(hid_t_f *obj_id, int_f *c_valid) +{ + int ret_value; + htri_t c_ret_value; + + /* + * Call H5Iis_valid + */ + if ((c_ret_value = H5Iis_valid(*obj_id)) < 0) + HGOTO_DONE(FAIL); + + /* Set output & return values */ + *c_valid = (int_f)c_ret_value; + ret_value=0; + +done: + return ret_value; +} diff --git a/fortran/src/H5Iff.f90 b/fortran/src/H5Iff.f90 index 07b6d29..83587ce 100644 --- a/fortran/src/H5Iff.f90 +++ b/fortran/src/H5Iff.f90 @@ -72,9 +72,9 @@ INTERFACE INTEGER FUNCTION h5iget_type_c(obj_id, type) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5IGET_TYPE_C':: h5iget_type_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IGET_TYPE_C':: h5iget_type_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER, INTENT(OUT) :: type END FUNCTION h5iget_type_c @@ -123,9 +123,9 @@ INTERFACE INTEGER FUNCTION h5iget_name_c(obj_id, buf, buf_size, name_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5IGET_NAME_C'::h5iget_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IGET_NAME_C'::h5iget_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(OUT) :: buf @@ -170,9 +170,9 @@ INTERFACE INTEGER FUNCTION h5iinc_ref_c(obj_id, ref_count) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5IINC_REF_C':: h5iinc_ref_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IINC_REF_C':: h5iinc_ref_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER, INTENT(OUT) :: ref_count END FUNCTION h5iinc_ref_c @@ -213,9 +213,9 @@ INTERFACE INTEGER FUNCTION h5idec_ref_c(obj_id, ref_count) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5IDEC_REF_C':: h5idec_ref_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IDEC_REF_C':: h5idec_ref_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER, INTENT(OUT) :: ref_count END FUNCTION h5idec_ref_c @@ -256,9 +256,9 @@ INTERFACE INTEGER FUNCTION h5iget_ref_c(obj_id, ref_count) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5IGET_REF_C':: h5iget_ref_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IGET_REF_C':: h5iget_ref_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER, INTENT(OUT) :: ref_count END FUNCTION h5iget_ref_c @@ -296,9 +296,9 @@ INTERFACE INTEGER FUNCTION h5iget_file_id_c(obj_id, file_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5IGET_FILE_ID_C':: h5iget_file_id_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IGET_FILE_ID_C':: h5iget_file_id_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER(HID_T), INTENT(OUT) :: file_id END FUNCTION h5iget_file_id_c @@ -306,5 +306,47 @@ hdferr = h5iget_file_id_c(obj_id, file_id) END SUBROUTINE h5iget_file_id_f +!---------------------------------------------------------------------- +! Name: H5Iis_valid_f +! +! Purpose: Check if an ID is valid without producing an error message +! +! Inputs: id - identifier +! Outputs: +! valid - status of id as a valid identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Programmer: M. Scot Breitenfeld +! April 13, 2009 +! +! Comment: +!---------------------------------------------------------------------- + SUBROUTINE h5iis_valid_f(id, valid, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: id ! Identifier + LOGICAL, INTENT(OUT) :: valid ! Status of id as a valid identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: c_valid ! 0 = .false, 1 = .true. + + INTERFACE + INTEGER FUNCTION h5iis_valid_c(id, c_valid) + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IIS_VALID_C':: h5iis_valid_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: id ! Identifier + INTEGER :: c_valid + END FUNCTION h5iis_valid_c + END INTERFACE + + hdferr = h5iis_valid_c(id, c_valid) + + valid = .FALSE. ! Default + IF(c_valid.EQ.1) valid = .TRUE. + + END SUBROUTINE h5iis_valid_f + + END MODULE H5I diff --git a/fortran/src/H5Lff.f90 b/fortran/src/H5Lff.f90 index 966e9f3..b1a0fd9 100644 --- a/fortran/src/H5Lff.f90 +++ b/fortran/src/H5Lff.f90 @@ -76,9 +76,9 @@ CONTAINS INTEGER FUNCTION h5lcopy_c(src_loc_id, src_name, src_namelen, dest_loc_id, dest_name, dest_namelen, & lcpl_id_default, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LCOPY_C'::h5lcopy_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LCOPY_C'::h5lcopy_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: src_name, dest_name INTEGER(HID_T), INTENT(IN) :: src_loc_id CHARACTER(LEN=*), INTENT(IN) :: src_name @@ -145,9 +145,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5ldelete_c(loc_id, name, namelen, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LDELETE_C'::h5ldelete_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LDELETE_C'::h5ldelete_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -213,9 +213,9 @@ CONTAINS link_name,link_name_len, & lcpl_id_default, lapl_id_default ) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_SOFT_C'::h5lcreate_soft_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_SOFT_C'::h5lcreate_soft_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: target_path, link_name CHARACTER(LEN=*), INTENT(IN) :: target_path INTEGER(SIZE_T) :: target_path_len @@ -295,9 +295,9 @@ CONTAINS link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_HARD_C'::h5lcreate_hard_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_HARD_C'::h5lcreate_hard_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: obj_name, link_name INTEGER(HID_T), INTENT(IN) :: obj_loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name @@ -379,9 +379,9 @@ CONTAINS link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_EXTERNAL_C'::h5lcreate_external_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_EXTERNAL_C'::h5lcreate_external_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: file_name, obj_name, link_name CHARACTER(LEN=*), INTENT(IN) :: file_name CHARACTER(LEN=*), INTENT(IN) :: obj_name @@ -473,9 +473,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LDELETE_BY_IDX_C'::h5ldelete_by_idx_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LDELETE_BY_IDX_C'::h5ldelete_by_idx_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: group_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: group_name @@ -536,9 +536,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LEXISTS_C'::h5lexists_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LEXISTS_C'::h5lexists_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -629,9 +629,9 @@ CONTAINS cset, corder, corder_valid, link_type, address, val_size, & lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_C'::h5lget_info_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_C'::h5lget_info_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: link_name INTEGER(HID_T), INTENT(IN) :: link_loc_id CHARACTER(LEN=*), INTENT(IN) :: link_name @@ -723,9 +723,9 @@ CONTAINS INTEGER FUNCTION h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & corder_valid, corder, cset, data_size, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_BY_IDX_C'::h5lget_info_by_idx_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_BY_IDX_C'::h5lget_info_by_idx_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: group_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: group_name @@ -790,9 +790,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5lis_registered_c(link_cls_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LIS_REGISTERED_C'::h5lis_registered_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LIS_REGISTERED_C'::h5lis_registered_c + !DEC$ENDIF INTEGER, INTENT(IN) :: link_cls_id ! User-defined link class identifier END FUNCTION h5lis_registered_c END INTERFACE @@ -858,9 +858,9 @@ CONTAINS INTEGER FUNCTION h5lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & dest_name, dest_namelen, lcpl_id_default, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LMOVE_C'::h5lmove_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LMOVE_C'::h5lmove_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: src_name, dest_name INTEGER(HID_T), INTENT(IN) :: src_loc_id CHARACTER(LEN=*), INTENT(IN) :: src_name @@ -949,9 +949,9 @@ CONTAINS INTEGER FUNCTION h5lget_name_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & size_default, name, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_NAME_BY_IDX_C'::h5lget_name_by_idx_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_NAME_BY_IDX_C'::h5lget_name_by_idx_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: group_name, name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: group_name @@ -1048,9 +1048,9 @@ CONTAINS !!$ INTEGER FUNCTION h5lget_val_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & !!$ corder_valid, corder, cset, data_size, lapl_id_default) !!$ USE H5GLOBAL -!!$ !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_BY_IDX_C'::h5lget_val_by_idx_c -!!$ !DEC$ ENDIF +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_BY_IDX_C'::h5lget_val_by_idx_c +!!$ !DEC$ENDIF !!$ INTEGER(HID_T), INTENT(IN) :: loc_id !!$ CHARACTER(LEN=*), INTENT(IN) :: group_name !!$ INTEGER(SIZE_T) :: group_namelen @@ -1130,9 +1130,9 @@ CONTAINS !!$ INTEGER FUNCTION h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & !!$ lapl_id_default) !!$ USE H5GLOBAL -!!$ !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_C'::h5lget_val_c -!!$ !DEC$ ENDIF +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_C'::h5lget_val_c +!!$ !DEC$ENDIF !!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. !!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. !!$ INTEGER :: link_namelen @@ -1221,9 +1221,9 @@ CONTAINS !!$ del_func, del_func_len, & !!$ query_func,query_func_len) !!$ USE H5GLOBAL -!!$ !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LREGISTERED_C'::H5Lregistered_c -!!$ !DEC$ ENDIF +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LREGISTERED_C'::H5Lregistered_c +!!$ !DEC$ENDIF !!$ INTEGER, INTENT(IN) :: version ! Version number of this struct !!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier !!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index ef58d47..a541502 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -66,9 +66,9 @@ CONTAINS INTEGER FUNCTION h5olink_c(object_id, new_loc_id, new_link_name, new_link_namelen, & lcpl_id_default, lapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5OLINK_C'::h5olink_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OLINK_C'::h5olink_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: new_link_name INTEGER(HID_T), INTENT(IN) :: object_id INTEGER(HID_T), INTENT(IN) :: new_loc_id @@ -132,9 +132,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5OOPEN_C'::h5oopen_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OOPEN_C'::h5oopen_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index ef38b31..95616db 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -4439,3 +4439,70 @@ nh5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) ret_value = 0; return ret_value; } + +/*---------------------------------------------------------------------------- + * Name: h5pset_chunk_cache_c + * Purpose: Calls H5Pset_chunk_cache + * + * Inputs: dapl_id - Link creation property list identifier + * rdcc_nslots - + * rdcc_nbytes - + * rdcc_w0 - + * + * Returns: 0 on success, -1 on failure + * Programmer: M.S. Breitenfeld + * April 13, 2009 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0) +{ + int ret_value = -1; + + /* + * Call H5Pset_chunk_cache function. + */ + if( (H5Pset_chunk_cache((hid_t)*dapl_id, (size_t)*rdcc_nslots, (size_t)*rdcc_nbytes, (double)*rdcc_w0)) <0 ) + return ret_value; /* error occurred */ + + ret_value = 0; + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: h5pget_chunk_cache_c + * Purpose: Calls H5Pget_chunk_cache + * + * Inputs: dapl_id - Link creation property list identifier + * Outputs: + * rdcc_nslots - + * rdcc_nbytes - + * rdcc_w0 - + * + * Returns: 0 on success, -1 on failure + * Programmer: M.S. Breitenfeld + * April 13, 2009 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0) +{ + int ret_value = -1; + size_t c_rdcc_nslots; + size_t c_rdcc_nbytes; + double c_rdcc_w0; + /* + * Call H5Pget_chunk_cache function. + */ + if( (H5Pget_chunk_cache((hid_t)*dapl_id, &c_rdcc_nslots, &c_rdcc_nbytes, &c_rdcc_w0)) <0 ) + return ret_value; /* error occurred */ + + *rdcc_nslots=(size_t_f)c_rdcc_nslots; + *rdcc_nbytes=(size_t_f)c_rdcc_nbytes; + *rdcc_w0=(real_f)c_rdcc_w0; + + ret_value = 0; + return ret_value; +} diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index f8cc771..c35c383 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -114,9 +114,9 @@ INTERFACE INTEGER FUNCTION h5pcreate_c(class, prp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PCREATE_C'::h5pcreate_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCREATE_C'::h5pcreate_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: class INTEGER(HID_T), INTENT(OUT) :: prp_id END FUNCTION h5pcreate_c @@ -171,9 +171,9 @@ INTERFACE INTEGER FUNCTION h5pset_preserve_c(prp_id, flag_c) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_PRESERVE_C'::h5pset_preserve_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_PRESERVE_C'::h5pset_preserve_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER :: flag_c END FUNCTION h5pset_preserve_c @@ -226,9 +226,9 @@ INTERFACE INTEGER FUNCTION h5pget_preserve_c(prp_id, flag_c) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_PRESERVE_C'::h5pget_preserve_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_PRESERVE_C'::h5pget_preserve_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER :: flag_c END FUNCTION h5pget_preserve_c @@ -291,9 +291,9 @@ INTERFACE INTEGER FUNCTION h5pget_class_c(prp_id, classtype) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_C'::h5pget_class_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_C'::h5pget_class_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: classtype END FUNCTION h5pget_class_c @@ -343,9 +343,9 @@ INTERFACE INTEGER FUNCTION h5pcopy_c(prp_id, new_prp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PCOPY_C'::h5pcopy_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCOPY_C'::h5pcopy_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(OUT) :: new_prp_id END FUNCTION h5pcopy_c @@ -391,9 +391,9 @@ INTERFACE INTEGER FUNCTION h5pclose_c(prp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PCLOSE_C'::h5pclose_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCLOSE_C'::h5pclose_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id END FUNCTION h5pclose_c END INTERFACE @@ -444,9 +444,9 @@ INTERFACE INTEGER FUNCTION h5pset_chunk_c(prp_id, ndims, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHUNK_C'::h5pset_chunk_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHUNK_C'::h5pset_chunk_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: ndims INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims @@ -502,9 +502,9 @@ INTERFACE INTEGER FUNCTION h5pget_chunk_c(prp_id, ndims, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHUNK_C'::h5pget_chunk_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHUNK_C'::h5pget_chunk_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER :: ndims INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims @@ -552,9 +552,9 @@ INTERFACE INTEGER FUNCTION h5pset_deflate_c(prp_id, level) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_DEFLATE_C'::h5pset_deflate_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_DEFLATE_C'::h5pset_deflate_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: level END FUNCTION h5pset_deflate_c @@ -609,9 +609,9 @@ INTERFACE INTEGER FUNCTION h5pset_fill_value_integer_c(prp_id, type_id, fillvalue) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_INTEGER_C'::h5pset_fill_value_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_INTEGER_C'::h5pset_fill_value_integer_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: fillvalue @@ -638,9 +638,9 @@ INTERFACE INTEGER FUNCTION h5pget_fill_value_integer_c(prp_id, type_id, fillvalue) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_INTEGER_C'::h5pget_fill_value_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_INTEGER_C'::h5pget_fill_value_integer_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(IN) :: type_id INTEGER :: fillvalue @@ -667,9 +667,9 @@ INTERFACE INTEGER FUNCTION h5pset_fill_value_real_c(prp_id, type_id, fillvalue) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_REAL_C'::h5pset_fill_value_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_REAL_C'::h5pset_fill_value_real_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(IN) :: type_id REAL, INTENT(IN) :: fillvalue @@ -696,9 +696,9 @@ INTERFACE INTEGER FUNCTION h5pget_fill_value_real_c(prp_id, type_id, fillvalue) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_REAL_C'::h5pget_fill_value_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_REAL_C'::h5pget_fill_value_real_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(IN) :: type_id REAL :: fillvalue @@ -726,9 +726,9 @@ INTERFACE INTEGER FUNCTION h5pset_fill_valuec_c(prp_id, type_id, fillvalue) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUEC_C'::h5pset_fill_valuec_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUEC_C'::h5pset_fill_valuec_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: fillvalue INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(IN) :: type_id @@ -755,9 +755,9 @@ INTERFACE INTEGER FUNCTION h5pget_fill_valuec_c(prp_id, type_id, fillvalue) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUEC_C'::h5pget_fill_valuec_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUEC_C'::h5pget_fill_valuec_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: fillvalue INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(IN) :: type_id @@ -818,9 +818,9 @@ INTERFACE INTEGER FUNCTION h5pget_version_c(prp_id, boot, freelist, stab, shhdr) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_VERSION_C'::h5pget_version_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_VERSION_C'::h5pget_version_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, DIMENSION(:), INTENT(OUT) :: boot INTEGER, DIMENSION(:), INTENT(OUT) :: freelist @@ -869,9 +869,9 @@ INTERFACE INTEGER FUNCTION h5pset_userblock_c(prp_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_USERBLOCK_C'::h5pset_userblock_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_USERBLOCK_C'::h5pset_userblock_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HSIZE_T), INTENT(IN) :: size END FUNCTION h5pset_userblock_c @@ -919,9 +919,9 @@ INTERFACE INTEGER FUNCTION h5pget_userblock_c(prp_id, block_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_USERBLOCK_C'::h5pget_userblock_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_USERBLOCK_C'::h5pget_userblock_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HSIZE_T), INTENT(OUT) :: block_size END FUNCTION h5pget_userblock_c @@ -971,9 +971,9 @@ INTERFACE INTEGER FUNCTION h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SIZES_C'::h5pset_sizes_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SIZES_C'::h5pset_sizes_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr INTEGER(SIZE_T), INTENT(IN) :: sizeof_size @@ -1027,9 +1027,9 @@ INTERFACE INTEGER FUNCTION h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIZES_C'::h5pget_sizes_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIZES_C'::h5pget_sizes_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size @@ -1080,9 +1080,9 @@ INTERFACE INTEGER FUNCTION h5pset_sym_k_c(prp_id, ik, lk) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SYM_K_C'::h5pset_sym_k_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SYM_K_C'::h5pset_sym_k_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: ik INTEGER, INTENT(IN) :: lk @@ -1133,9 +1133,9 @@ INTERFACE INTEGER FUNCTION h5pget_sym_k_c(prp_id, ik, lk) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_SYM_K_C'::h5pget_sym_k_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SYM_K_C'::h5pget_sym_k_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: ik INTEGER, INTENT(OUT) :: lk @@ -1184,9 +1184,9 @@ INTERFACE INTEGER FUNCTION h5pset_istore_k_c(prp_id, ik) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_ISTORE_K_C'::h5pset_istore_k_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ISTORE_K_C'::h5pset_istore_k_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: ik END FUNCTION h5pset_istore_k_c @@ -1233,9 +1233,9 @@ INTERFACE INTEGER FUNCTION h5pget_istore_k_c(prp_id, ik) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_ISTORE_K_C'::h5pget_istore_k_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ISTORE_K_C'::h5pget_istore_k_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: ik END FUNCTION h5pget_istore_k_c @@ -1282,9 +1282,9 @@ INTERFACE INTEGER FUNCTION h5pget_driver_c(prp_id, driver) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_DRIVER_C'::h5pget_driver_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_DRIVER_C'::h5pget_driver_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(OUT) :: driver END FUNCTION h5pget_driver_c @@ -1328,9 +1328,9 @@ INTERFACE INTEGER FUNCTION h5pset_fapl_stdio_c(prp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_STDIO_C'::h5pset_fapl_stdio_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_STDIO_C'::h5pset_fapl_stdio_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id END FUNCTION h5pset_fapl_stdio_c END INTERFACE @@ -1408,9 +1408,9 @@ INTERFACE INTEGER FUNCTION h5pset_fapl_sec2_c(prp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_SEC2_C'::h5pset_fapl_sec2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_SEC2_C'::h5pset_fapl_sec2_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier END FUNCTION h5pset_fapl_sec2_c END INTERFACE @@ -1491,9 +1491,9 @@ INTERFACE INTEGER FUNCTION h5pset_alignment_c(prp_id, threshold, alignment) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_ALIGNMENT_C'::h5pset_alignment_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ALIGNMENT_C'::h5pset_alignment_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HSIZE_T), INTENT(IN) :: threshold INTEGER(HSIZE_T), INTENT(IN) :: alignment @@ -1543,9 +1543,9 @@ INTERFACE INTEGER FUNCTION h5pget_alignment_c(prp_id, threshold, alignment) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_ALIGNMENT_C'::h5pget_alignment_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ALIGNMENT_C'::h5pget_alignment_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HSIZE_T), INTENT(OUT) :: threshold INTEGER(HSIZE_T), INTENT(OUT) :: alignment @@ -1598,9 +1598,9 @@ INTERFACE INTEGER FUNCTION h5pset_fapl_core_c(prp_id, increment, backing_store_flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_CORE_C'::h5pset_fapl_core_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_CORE_C'::h5pset_fapl_core_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(SIZE_T), INTENT(IN) :: increment INTEGER :: backing_store_flag @@ -1654,9 +1654,9 @@ INTERFACE INTEGER FUNCTION h5pget_fapl_core_c(prp_id, increment, backing_store_flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_CORE_C'::h5pget_fapl_core_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_CORE_C'::h5pget_fapl_core_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(SIZE_T), INTENT(OUT) :: increment INTEGER :: backing_store_flag @@ -1711,9 +1711,9 @@ INTERFACE INTEGER FUNCTION h5pset_fapl_family_c(prp_id, memb_size, memb_plist) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_FAMILY_C'::h5pset_fapl_family_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_FAMILY_C'::h5pset_fapl_family_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HSIZE_T), INTENT(IN) :: memb_size INTEGER(HID_T), INTENT(IN) :: memb_plist @@ -1767,9 +1767,9 @@ INTERFACE INTEGER FUNCTION h5pget_fapl_family_c(prp_id, memb_size, memb_plist) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_FAMILY_C'::h5pget_fapl_family_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_FAMILY_C'::h5pget_fapl_family_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HSIZE_T), INTENT(OUT) :: memb_size INTEGER(HID_T), INTENT(OUT) :: memb_plist @@ -1828,9 +1828,9 @@ INTERFACE INTEGER FUNCTION h5pset_cache_c(prp_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_CACHE_C'::h5pset_cache_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CACHE_C'::h5pset_cache_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: mdc_nelmts INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts @@ -1895,9 +1895,9 @@ INTERFACE INTEGER FUNCTION h5pget_cache_c(prp_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CACHE_C'::h5pget_cache_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CACHE_C'::h5pget_cache_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: mdc_nelmts INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts @@ -1958,9 +1958,9 @@ INTERFACE INTEGER FUNCTION h5pset_fapl_split_c(prp_id,meta_len,meta_ext,meta_plist,raw_len,raw_ext,raw_plist) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_SPLIT_C'::h5pset_fapl_split_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_SPLIT_C'::h5pset_fapl_split_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: meta_ext !DEC$ATTRIBUTES reference :: raw_ext INTEGER(HID_T), INTENT(IN) :: prp_id @@ -2065,9 +2065,9 @@ INTERFACE INTEGER FUNCTION h5pset_gc_references_c(prp_id, gc_reference) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_GC_REFERENCES_C'::h5pset_gc_references_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_GC_REFERENCES_C'::h5pset_gc_references_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: gc_reference END FUNCTION h5pset_gc_references_c @@ -2115,9 +2115,9 @@ INTERFACE INTEGER FUNCTION h5pget_gc_references_c(prp_id, gc_reference) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_GC_REFERENCES_C'::h5pget_gc_references_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_GC_REFERENCES_C'::h5pget_gc_references_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: gc_reference END FUNCTION h5pget_gc_references_c @@ -2172,9 +2172,9 @@ INTERFACE INTEGER FUNCTION h5pset_layout_c(prp_id, layout) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LAYOUT_C'::h5pset_layout_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LAYOUT_C'::h5pset_layout_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: layout END FUNCTION h5pset_layout_c @@ -2228,9 +2228,9 @@ INTERFACE INTEGER FUNCTION h5pget_layout_c(prp_id, layout) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_LAYOUT_C'::h5pget_layout_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_LAYOUT_C'::h5pget_layout_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: layout END FUNCTION h5pget_layout_c @@ -2284,9 +2284,9 @@ INTERFACE INTEGER FUNCTION h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILTER_C'::h5pset_filter_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILTER_C'::h5pset_filter_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: filter INTEGER, INTENT(IN) :: flags @@ -2336,9 +2336,9 @@ INTERFACE INTEGER FUNCTION h5pget_nfilters_c(prp_id, nfilters) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_NFILTERS_C'::h5pget_nfilters_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_NFILTERS_C'::h5pget_nfilters_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: nfilters END FUNCTION h5pget_nfilters_c @@ -2404,9 +2404,9 @@ INTEGER FUNCTION h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & cd_values, namelen, name, filter_id ) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILTER_C'::h5pget_filter_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILTER_C'::h5pget_filter_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: filter_number @@ -2471,9 +2471,9 @@ INTERFACE INTEGER FUNCTION h5pset_external_c(prp_id, name,namelen, offset, bytes) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_EXTERNAL_C'::h5pset_external_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_EXTERNAL_C'::h5pset_external_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -2525,9 +2525,9 @@ INTERFACE INTEGER FUNCTION h5pget_external_count_c(prp_id, count) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_EXTERNAL_COUNT_C'::h5pget_external_count_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_EXTERNAL_COUNT_C'::h5pget_external_count_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: count END FUNCTION h5pget_external_count_c @@ -2588,9 +2588,9 @@ INTERFACE INTEGER FUNCTION h5pget_external_c(prp_id, idx, name_size, name, offset, bytes) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_EXTERNAL_C'::h5pget_external_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_EXTERNAL_C'::h5pget_external_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: idx @@ -2649,9 +2649,9 @@ INTERFACE INTEGER FUNCTION h5pset_btree_ratios_c(prp_id, left, middle, right) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_BTREE_RATIOS_C'::h5pset_btree_ratios_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_BTREE_RATIOS_C'::h5pset_btree_ratios_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id REAL, INTENT(IN) :: left REAL, INTENT(IN) :: middle @@ -2707,9 +2707,9 @@ INTERFACE INTEGER FUNCTION h5pget_btree_ratios_c(prp_id, left, middle, right) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_BTREE_RATIOS_C'::h5pget_btree_ratios_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_BTREE_RATIOS_C'::h5pget_btree_ratios_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id REAL, INTENT(OUT) :: left REAL, INTENT(OUT) :: middle @@ -2766,9 +2766,9 @@ INTERFACE INTEGER FUNCTION h5pget_fclose_degree_c(fapl_id, degree) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FCLOSE_DEGREE_C'::h5pget_fclose_degree_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FCLOSE_DEGREE_C'::h5pget_fclose_degree_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: fapl_id INTEGER, INTENT(OUT) :: degree END FUNCTION h5pget_fclose_degree_c @@ -2820,9 +2820,9 @@ INTERFACE INTEGER FUNCTION h5pset_fclose_degree_c(fapl_id, degree) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FCLOSE_DEGREE_C'::h5pset_fclose_degree_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FCLOSE_DEGREE_C'::h5pset_fclose_degree_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: fapl_id INTEGER, INTENT(IN) :: degree END FUNCTION h5pset_fclose_degree_c @@ -2867,9 +2867,9 @@ INTERFACE INTEGER FUNCTION h5pequal_c(plist1_id, plist2_id, c_flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PEQUAL_C'::h5pequal_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PEQUAL_C'::h5pequal_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist1_id INTEGER(HID_T), INTENT(IN) :: plist2_id INTEGER, INTENT(OUT) :: c_flag @@ -2915,9 +2915,9 @@ INTERFACE INTEGER FUNCTION h5pset_buffer_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_BUFFER_C'::h5pset_buffer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_BUFFER_C'::h5pset_buffer_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(HSIZE_T), INTENT(IN) :: size END FUNCTION h5pset_buffer_c @@ -2960,9 +2960,9 @@ INTERFACE INTEGER FUNCTION h5pget_buffer_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_BUFFER_C'::h5pget_buffer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_BUFFER_C'::h5pget_buffer_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5pget_buffer_c @@ -3008,9 +3008,9 @@ INTERFACE INTEGER FUNCTION h5pfill_value_defined_c(plist_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PFILL_VALUE_DEFINED_C'::h5pfill_value_defined_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PFILL_VALUE_DEFINED_C'::h5pfill_value_defined_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(OUT) :: flag END FUNCTION h5pfill_value_defined_c @@ -3057,9 +3057,9 @@ INTERFACE INTEGER FUNCTION h5pset_alloc_time_c(plist_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_ALLOC_TIME_C'::h5pset_alloc_time_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ALLOC_TIME_C'::h5pset_alloc_time_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(IN) :: flag END FUNCTION h5pset_alloc_time_c @@ -3106,9 +3106,9 @@ INTERFACE INTEGER FUNCTION h5pget_alloc_time_c(plist_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_ALLOC_TIME_C'::h5pget_alloc_time_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ALLOC_TIME_C'::h5pget_alloc_time_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(OUT) :: flag END FUNCTION h5pget_alloc_time_c @@ -3153,9 +3153,9 @@ INTERFACE INTEGER FUNCTION h5pset_fill_time_c(plist_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_TIME_C'::h5pset_fill_time_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_TIME_C'::h5pset_fill_time_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(IN) :: flag END FUNCTION h5pset_fill_time_c @@ -3200,9 +3200,9 @@ INTERFACE INTEGER FUNCTION h5pget_fill_time_c(plist_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_TIME_C'::h5pget_fill_time_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_TIME_C'::h5pget_fill_time_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(OUT) :: flag END FUNCTION h5pget_fill_time_c @@ -3243,9 +3243,9 @@ INTERFACE INTEGER FUNCTION h5pset_meta_block_size_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_META_BLOCK_SIZE_C'::h5pset_meta_block_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_META_BLOCK_SIZE_C'::h5pset_meta_block_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(HSIZE_T), INTENT(IN) :: size END FUNCTION h5pset_meta_block_size_c @@ -3286,9 +3286,9 @@ INTERFACE INTEGER FUNCTION h5pget_meta_block_size_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_META_BLOCK_SIZE_C'::h5pget_meta_block_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_META_BLOCK_SIZE_C'::h5pget_meta_block_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5pget_meta_block_size_c @@ -3329,9 +3329,9 @@ INTERFACE INTEGER FUNCTION h5pset_sieve_buf_size_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SIEVE_BUF_SIZE_C'::h5pset_sieve_buf_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SIEVE_BUF_SIZE_C'::h5pset_sieve_buf_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(SIZE_T), INTENT(IN) :: size END FUNCTION h5pset_sieve_buf_size_c @@ -3372,9 +3372,9 @@ INTERFACE INTEGER FUNCTION h5pget_sieve_buf_size_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIEVE_BUF_SIZE_C'::h5pget_sieve_buf_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIEVE_BUF_SIZE_C'::h5pget_sieve_buf_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(SIZE_T), INTENT(OUT) :: size END FUNCTION h5pget_sieve_buf_size_c @@ -3415,9 +3415,9 @@ INTERFACE INTEGER FUNCTION h5pset_small_data_block_size_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SMALL_DATA_BLOCK_SIZE_C'::h5pset_small_data_block_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SMALL_DATA_BLOCK_SIZE_C'::h5pset_small_data_block_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(HSIZE_T), INTENT(IN) :: size END FUNCTION h5pset_small_data_block_size_c @@ -3458,9 +3458,9 @@ INTERFACE INTEGER FUNCTION h5pget_small_data_block_size_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_SMALL_DATA_BLOCK_SIZE_C'::h5pget_small_data_block_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SMALL_DATA_BLOCK_SIZE_C'::h5pget_small_data_block_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5pget_small_data_block_size_c @@ -3501,9 +3501,9 @@ INTERFACE INTEGER FUNCTION h5pset_hyper_vector_size_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_HYPER_VECTOR_SIZE_C'::h5pset_hyper_vector_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_HYPER_VECTOR_SIZE_C'::h5pset_hyper_vector_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(SIZE_T), INTENT(IN) :: size END FUNCTION h5pset_hyper_vector_size_c @@ -3544,9 +3544,9 @@ INTERFACE INTEGER FUNCTION h5pget_hyper_vector_size_c(plist_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_HYPER_VECTOR_SIZE_C'::h5pget_hyper_vector_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_HYPER_VECTOR_SIZE_C'::h5pget_hyper_vector_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(SIZE_T), INTENT(OUT) :: size END FUNCTION h5pget_hyper_vector_size_c @@ -3590,9 +3590,9 @@ INTERFACE INTEGER FUNCTION h5pset_integer_c(prp_id, name, name_len, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_INTEGER_C'::h5pset_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_INTEGER_C'::h5pset_integer_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -3640,9 +3640,9 @@ INTERFACE INTEGER FUNCTION h5pset_real_c(prp_id, name, name_len, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_REAL_C'::h5pset_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_REAL_C'::h5pset_real_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -3692,9 +3692,9 @@ INTERFACE INTEGER FUNCTION h5psetc_c(prp_id, name, name_len, value, value_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSETC_C'::h5psetc_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSETC_C'::h5psetc_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name !DEC$ATTRIBUTES reference :: value INTEGER(HID_T), INTENT(IN) :: prp_id @@ -3745,9 +3745,9 @@ INTERFACE INTEGER FUNCTION h5pget_integer_c(prp_id, name, name_len, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_INTEGER_C'::h5pget_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_INTEGER_C'::h5pget_integer_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -3795,9 +3795,9 @@ INTERFACE INTEGER FUNCTION h5pget_real_c(prp_id, name, name_len, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_REAL_C'::h5pget_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_REAL_C'::h5pget_real_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -3847,9 +3847,9 @@ INTERFACE INTEGER FUNCTION h5pgetc_c(prp_id, name, name_len, value, value_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGETC_C'::h5pgetc_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGETC_C'::h5pgetc_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name !DEC$ATTRIBUTES reference :: value INTEGER(HID_T), INTENT(IN) :: prp_id @@ -3901,9 +3901,9 @@ INTERFACE INTEGER FUNCTION h5pexist_c(prp_id, name, name_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PEXIST_C'::h5pexist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PEXIST_C'::h5pexist_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -3954,9 +3954,9 @@ INTERFACE INTEGER FUNCTION h5pget_size_c(prp_id, name, name_len, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIZE_C'::h5pget_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIZE_C'::h5pget_size_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -4000,9 +4000,9 @@ INTERFACE INTEGER FUNCTION h5pget_nprops_c(prp_id, nprops) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_NPROPS_C'::h5pget_nprops_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_NPROPS_C'::h5pget_nprops_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(SIZE_T), INTENT(OUT) :: nprops END FUNCTION h5pget_nprops_c @@ -4049,9 +4049,9 @@ INTERFACE INTEGER FUNCTION h5pget_class_name_c(prp_id, name, name_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_NAME_C'::h5pget_class_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_NAME_C'::h5pget_class_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(INOUT) :: name @@ -4101,9 +4101,9 @@ INTERFACE INTEGER FUNCTION h5pget_class_parent_c(prp_id, parent_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_PARENT_C'::h5pget_class_parent_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_PARENT_C'::h5pget_class_parent_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(OUT) :: parent_id END FUNCTION h5pget_class_parent_c @@ -4146,9 +4146,9 @@ INTERFACE INTEGER FUNCTION h5pisa_class_c(plist, pclass) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PISA_CLASS_C'::h5pisa_class_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PISA_CLASS_C'::h5pisa_class_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist INTEGER(HID_T), INTENT(IN) :: pclass END FUNCTION h5pisa_class_c @@ -4198,9 +4198,9 @@ INTERFACE INTEGER FUNCTION h5pcopy_prop_c(dst_id, src_id, name, name_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PCOPY_PROP_C'::h5pcopy_prop_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCOPY_PROP_C'::h5pcopy_prop_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: dst_id INTEGER(HID_T), INTENT(IN) :: src_id @@ -4247,9 +4247,9 @@ INTERFACE INTEGER FUNCTION h5premove_c(plid, name, name_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PREMOVE_C'::h5premove_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREMOVE_C'::h5premove_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: plid CHARACTER(LEN=*), INTENT(IN) :: name @@ -4295,9 +4295,9 @@ INTERFACE INTEGER FUNCTION h5punregister_c(class, name, name_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PUNREGISTER_C'::h5punregister_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PUNREGISTER_C'::h5punregister_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: class CHARACTER(LEN=*), INTENT(IN) :: name @@ -4340,9 +4340,9 @@ INTERFACE INTEGER FUNCTION h5pclose_class_c(class) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PCLOSE_CLASS_C'::h5pclose_class_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCLOSE_CLASS_C'::h5pclose_class_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: class END FUNCTION h5pclose_class_c END INTERFACE @@ -4395,9 +4395,9 @@ INTEGER FUNCTION h5pcreate_class_c(parent, name, name_len,& class) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PCREATE_CLASS_C'::h5pcreate_class_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCREATE_CLASS_C'::h5pcreate_class_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: parent CHARACTER(LEN=*), INTENT(IN) :: name @@ -4449,9 +4449,9 @@ INTERFACE INTEGER FUNCTION h5pregister_integer_c(class, name, name_len, size, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_INTEGER_C'::h5pregister_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_INTEGER_C'::h5pregister_integer_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: class CHARACTER(LEN=*), INTENT(IN) :: name @@ -4504,9 +4504,9 @@ INTERFACE INTEGER FUNCTION h5pregister_real_c(class, name, name_len, size, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_REAL_C'::h5pregister_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_REAL_C'::h5pregister_real_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: class CHARACTER(LEN=*), INTENT(IN) :: name @@ -4561,9 +4561,9 @@ INTEGER FUNCTION h5pregisterc_c(class, name, name_len, size, value, & value_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PREGISTERC_C'::h5pregisterc_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTERC_C'::h5pregisterc_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name !DEC$ATTRIBUTES reference :: value INTEGER(HID_T), INTENT(IN) :: class @@ -4617,9 +4617,9 @@ INTERFACE INTEGER FUNCTION h5pinsert_integer_c(plist, name, name_len, size, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_INTEGER_C'::h5pinsert_integer_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_INTEGER_C'::h5pinsert_integer_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: plist CHARACTER(LEN=*), INTENT(IN) :: name @@ -4671,9 +4671,9 @@ INTERFACE INTEGER FUNCTION h5pinsert_real_c(plist, name, name_len, size, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_REAL_C'::h5pinsert_real_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_REAL_C'::h5pinsert_real_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: plist CHARACTER(LEN=*), INTENT(IN) :: name @@ -4727,9 +4727,9 @@ INTERFACE INTEGER FUNCTION h5pinsertc_c(plist, name, name_len, size, value, value_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PINSERTC_C'::h5pinsertc_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERTC_C'::h5pinsertc_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name !DEC$ATTRIBUTES reference :: value INTEGER(HID_T), INTENT(IN) :: plist @@ -4780,9 +4780,9 @@ INTERFACE INTEGER FUNCTION h5pset_shuffle_c(prp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHUFFLE_C'::h5pset_shuffle_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHUFFLE_C'::h5pset_shuffle_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id END FUNCTION h5pset_shuffle_c END INTERFACE @@ -4828,9 +4828,9 @@ INTERFACE INTEGER FUNCTION h5pset_edc_check_c(prp_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_EDC_CHECK_C'::h5pset_edc_check_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_EDC_CHECK_C'::h5pset_edc_check_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: flag END FUNCTION h5pset_edc_check_c @@ -4879,9 +4879,9 @@ INTERFACE INTEGER FUNCTION h5pget_edc_check_c(prp_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_EDC_CHECK_C'::h5pget_edc_check_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_EDC_CHECK_C'::h5pget_edc_check_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: flag END FUNCTION h5pget_edc_check_c @@ -4924,9 +4924,9 @@ INTERFACE INTEGER FUNCTION h5pset_fletcher32_c(prp_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FLETCHER32_C'::h5pset_fletcher32_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FLETCHER32_C'::h5pset_fletcher32_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id END FUNCTION h5pset_fletcher32_c END INTERFACE @@ -4970,9 +4970,9 @@ INTERFACE INTEGER FUNCTION h5pset_family_offset_c(prp_id, offset) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAMILY_OFFSET_C'::h5pset_family_offset_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAMILY_OFFSET_C'::h5pset_family_offset_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HSIZE_T), INTENT(IN) :: offset END FUNCTION h5pset_family_offset_c @@ -5030,9 +5030,9 @@ INTEGER FUNCTION h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, & maxlen, memb_addr, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_MULTI_C'::h5pset_fapl_multi_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_MULTI_C'::h5pset_fapl_multi_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: memb_name INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_map @@ -5091,9 +5091,9 @@ INTERFACE INTEGER FUNCTION h5pset_fapl_multi_sc(prp_id,flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_MULTI_SC'::h5pset_fapl_multi_sc - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_MULTI_SC'::h5pset_fapl_multi_sc + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, INTENT(IN) :: flag END FUNCTION h5pset_fapl_multi_sc @@ -5154,9 +5154,9 @@ INTEGER FUNCTION h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, & maxlen, memb_addr, flag, c_maxlen_out) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_MULTI_C'::h5pget_fapl_multi_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_MULTI_C'::h5pget_fapl_multi_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: memb_name INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_map @@ -5217,9 +5217,9 @@ INTERFACE INTEGER FUNCTION h5pset_szip_c(prp_id, options_mask, pixels_per_block) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SZIP_C'::h5pset_szip_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SZIP_C'::h5pset_szip_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, INTENT(IN) :: options_mask INTEGER, INTENT(IN) :: pixels_per_block @@ -5269,9 +5269,9 @@ INTERFACE INTEGER FUNCTION h5pall_filters_avail_c(prp_id, status) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PALL_FILTERS_AVAIL_C'::h5pall_filters_avail_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PALL_FILTERS_AVAIL_C'::h5pall_filters_avail_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, INTENT(OUT) :: status END FUNCTION h5pall_filters_avail_c @@ -5334,9 +5334,9 @@ INTEGER FUNCTION h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & cd_values, namelen, name) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILTER_BY_ID_C'::h5pget_filter_by_id_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILTER_BY_ID_C'::h5pget_filter_by_id_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: filter_id @@ -5397,9 +5397,9 @@ INTERFACE INTEGER FUNCTION h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PMODIFY_FILTER_C'::h5pmodify_filter_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PMODIFY_FILTER_C'::h5pmodify_filter_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: filter INTEGER, INTENT(IN) :: flags @@ -5448,9 +5448,9 @@ INTERFACE INTEGER FUNCTION h5premove_filter_c(prp_id, filter) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PREMOVE_FILTER_C'::h5premove_filter_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREMOVE_FILTER_C'::h5premove_filter_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: filter END FUNCTION h5premove_filter_c @@ -5499,9 +5499,9 @@ INTERFACE INTEGER FUNCTION h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_ATTR_PHASE_CHANGE_C'::h5pget_attr_phase_change_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ATTR_PHASE_CHANGE_C'::h5pget_attr_phase_change_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: ocpl_id INTEGER, INTENT(OUT) :: max_compact INTEGER, INTENT(OUT) :: min_dense @@ -5547,9 +5547,9 @@ INTERFACE INTEGER FUNCTION H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_ATTR_CREATION_ORDER_C'::h5pset_attr_creation_order_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ATTR_CREATION_ORDER_C'::h5pset_attr_creation_order_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: ocpl_id INTEGER, INTENT(IN) :: crt_order_flags @@ -5595,9 +5595,9 @@ INTERFACE INTEGER FUNCTION h5pset_shared_mesg_nindexes_c(plist_id, nindexes) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHARED_MESG_NINDEXES_C'::h5pset_shared_mesg_nindexes_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHARED_MESG_NINDEXES_C'::h5pset_shared_mesg_nindexes_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(IN) :: nindexes @@ -5649,9 +5649,9 @@ INTEGER FUNCTION h5pset_shared_mesg_index_c(fcpl_id, index_num, mesg_type_flags, min_mesg_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHARED_MESG_INDEX_C'::h5pset_shared_mesg_index_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHARED_MESG_INDEX_C'::h5pset_shared_mesg_index_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: fcpl_id INTEGER, INTENT(IN) :: index_num @@ -5701,9 +5701,9 @@ INTEGER FUNCTION h5pget_attr_creation_order_c(ocpl_id, crt_order_flags) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_ATTR_CREATION_ORDER_C'::h5pget_attr_creation_order_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ATTR_CREATION_ORDER_C'::h5pget_attr_creation_order_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: ocpl_id INTEGER, INTENT(OUT) :: crt_order_flags @@ -5757,9 +5757,9 @@ INTEGER FUNCTION h5pset_libver_bounds_c(fapl_id, low, high) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LIBVER_BOUNDS_C'::h5pset_libver_bounds_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LIBVER_BOUNDS_C'::h5pset_libver_bounds_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: fapl_id INTEGER, INTENT(IN) :: low INTEGER, INTENT(IN) :: high @@ -5807,9 +5807,9 @@ INTEGER FUNCTION h5pset_link_creation_order_c(gcpl_id, crt_order_flags) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LINK_CREATION_ORDER_C'::h5pset_link_creation_order_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LINK_CREATION_ORDER_C'::h5pset_link_creation_order_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(IN) :: crt_order_flags @@ -5856,9 +5856,9 @@ INTERFACE INTEGER FUNCTION h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_LINK_PHASE_CHANGE_C'::h5pget_link_phase_change_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_LINK_PHASE_CHANGE_C'::h5pget_link_phase_change_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(OUT) :: max_compact INTEGER, INTENT(OUT) :: min_dense @@ -5906,9 +5906,9 @@ INTERFACE INTEGER FUNCTION h5pget_obj_track_times_c(plist_id, status) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_OBJ_TRACK_TIMES_C'::h5pget_obj_track_times_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_OBJ_TRACK_TIMES_C'::h5pget_obj_track_times_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier INTEGER, INTENT(OUT) :: status END FUNCTION h5pget_obj_track_times_c @@ -5970,9 +5970,9 @@ INTERFACE INTEGER FUNCTION h5pset_obj_track_times_c(plist_id, status) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_OBJ_TRACK_TIMES_C'::h5pset_obj_track_times_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_OBJ_TRACK_TIMES_C'::h5pset_obj_track_times_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier INTEGER, INTENT(IN) :: status END FUNCTION h5pset_obj_track_times_c @@ -6023,9 +6023,9 @@ INTERFACE INTEGER FUNCTION h5pset_create_inter_group_c(lcpl_id, crt_intermed_group) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_CREATE_INTER_GROUP_C'::h5pset_create_inter_group_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CREATE_INTER_GROUP_C'::h5pset_create_inter_group_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: lcpl_id INTEGER, INTENT(IN) :: crt_intermed_group END FUNCTION h5pset_create_inter_group_c @@ -6071,9 +6071,9 @@ INTEGER FUNCTION h5pget_link_creation_order_c(gcpl_id, crt_order_flags) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_LINK_CREATION_ORDER_C'::h5pget_link_creation_order_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_LINK_CREATION_ORDER_C'::h5pget_link_creation_order_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(OUT) :: crt_order_flags @@ -6125,9 +6125,9 @@ INTEGER FUNCTION h5pset_char_encoding_c(plist_id, encoding) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHAR_ENCODING_C'::h5pset_char_encoding_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHAR_ENCODING_C'::h5pset_char_encoding_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(IN) :: encoding @@ -6179,9 +6179,9 @@ INTEGER FUNCTION h5pget_char_encoding_c(plist_id, encoding) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHAR_ENCODING_C'::h5pget_char_encoding_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHAR_ENCODING_C'::h5pget_char_encoding_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(OUT) :: encoding @@ -6232,9 +6232,9 @@ INTERFACE INTEGER FUNCTION h5pset_copy_object_c(ocp_plist_id, copy_options) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_COPY_OBJECT_C'::h5pset_copy_object_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_COPY_OBJECT_C'::h5pset_copy_object_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: ocp_plist_id INTEGER, INTENT(IN) :: copy_options END FUNCTION h5pset_copy_object_c @@ -6281,9 +6281,9 @@ INTERFACE INTEGER FUNCTION h5pget_copy_object_c(ocp_plist_id, copy_options) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_COPY_OBJECT_C'::h5pget_copy_object_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_COPY_OBJECT_C'::h5pget_copy_object_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: ocp_plist_id INTEGER, INTENT(OUT) :: copy_options END FUNCTION h5pget_copy_object_c @@ -6335,9 +6335,9 @@ INTERFACE INTEGER FUNCTION h5pget_data_transform_c(plist_id, expression, expression_len, size_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_DATA_TRANSFORM_C'::h5pget_data_transform_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_DATA_TRANSFORM_C'::h5pget_data_transform_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: expression INTEGER(HID_T), INTENT(IN) :: plist_id CHARACTER(LEN=*), INTENT(OUT) :: expression @@ -6390,9 +6390,9 @@ INTERFACE INTEGER FUNCTION h5pset_data_transform_c(plist_id, expression, expression_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_DATA_TRANSFORM_C'::h5pset_data_transform_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_DATA_TRANSFORM_C'::h5pset_data_transform_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: expression INTEGER(HID_T), INTENT(IN) :: plist_id CHARACTER(LEN=*), INTENT(IN) :: expression @@ -6439,9 +6439,9 @@ INTERFACE INTEGER FUNCTION h5pget_local_heap_size_hint_c(gcpl_id, size_hint) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_LOCAL_HEAP_SIZE_HINT_C'::h5pget_local_heap_size_hint_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_LOCAL_HEAP_SIZE_HINT_C'::h5pget_local_heap_size_hint_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER(SIZE_T), INTENT(OUT) :: size_hint END FUNCTION H5Pget_local_heap_size_hint_c @@ -6487,9 +6487,9 @@ INTERFACE INTEGER FUNCTION h5pget_est_link_info_c(gcpl_id, est_num_entries, est_name_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_EST_LINK_INFO_C'::h5pget_est_link_info_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_EST_LINK_INFO_C'::h5pget_est_link_info_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(OUT) :: est_num_entries INTEGER, INTENT(OUT) :: est_name_len @@ -6534,9 +6534,9 @@ INTERFACE INTEGER FUNCTION h5pset_local_heap_size_hint_c(gcpl_id, size_hint) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LOCAL_HEAP_SIZE_HINT_C'::h5pset_local_heap_size_hint_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LOCAL_HEAP_SIZE_HINT_C'::h5pset_local_heap_size_hint_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER(SIZE_T), INTENT(IN) :: size_hint END FUNCTION h5pset_local_heap_size_hint_c @@ -6582,9 +6582,9 @@ INTERFACE INTEGER FUNCTION h5pset_est_link_info_c(gcpl_id, est_num_entries, est_name_len) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_EST_LINK_INFO_C'::h5pset_est_link_info_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_EST_LINK_INFO_C'::h5pset_est_link_info_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(IN) :: est_num_entries INTEGER, INTENT(IN) :: est_name_len @@ -6631,9 +6631,9 @@ INTERFACE INTEGER FUNCTION h5pset_link_phase_change_c(gcpl_id, max_compact, min_dense) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LINK_PHASE_CHANGE_C'::h5pset_link_phase_change_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LINK_PHASE_CHANGE_C'::h5pset_link_phase_change_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(IN) :: max_compact INTEGER, INTENT(IN) :: min_dense @@ -6682,9 +6682,9 @@ INTERFACE INTEGER FUNCTION h5pset_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_DIRECT_C'::h5pset_fapl_direct_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_DIRECT_C'::h5pset_fapl_direct_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: fapl_id INTEGER(SIZE_T), INTENT(IN) :: alignment INTEGER(SIZE_T), INTENT(IN) :: block_size @@ -6733,9 +6733,9 @@ INTERFACE INTEGER FUNCTION h5pget_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_DIRECT_C'::h5pget_fapl_direct_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_DIRECT_C'::h5pget_fapl_direct_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: fapl_id INTEGER(SIZE_T), INTENT(OUT) :: alignment INTEGER(SIZE_T), INTENT(OUT) :: block_size @@ -6786,9 +6786,9 @@ INTERFACE INTEGER FUNCTION h5pset_attr_phase_change_c(ocpl_id, max_compact, min_dense) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_ATTR_PHASE_CHANGE_C'::h5pset_attr_phase_change_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ATTR_PHASE_CHANGE_C'::h5pset_attr_phase_change_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: ocpl_id INTEGER, INTENT(IN) :: max_compact INTEGER, INTENT(IN) :: min_dense @@ -6833,9 +6833,9 @@ INTERFACE INTEGER FUNCTION H5Pset_nbit_c(plist_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_NBIT_C'::h5pset_nbit_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_NBIT_C'::h5pset_nbit_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id END FUNCTION H5Pset_nbit_c END INTERFACE @@ -6880,9 +6880,9 @@ INTERFACE INTEGER FUNCTION h5pset_scaleoffset_c(plist_id, scale_type, scale_factor) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SCALEOFFSET_C'::h5pset_scaleoffset_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SCALEOFFSET_C'::h5pset_scaleoffset_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER, INTENT(IN) :: scale_type INTEGER, INTENT(IN) :: scale_factor @@ -6928,9 +6928,9 @@ INTERFACE INTEGER FUNCTION h5pset_nlinks_c(lapl_id, nlinks) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_NLINKS_C'::h5pset_nlinks_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_NLINKS_C'::h5pset_nlinks_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: lapl_id INTEGER(SIZE_T), INTENT(IN) :: nlinks END FUNCTION h5pset_nlinks_c @@ -6975,9 +6975,9 @@ INTERFACE INTEGER FUNCTION h5pget_nlinks_c(lapl_id, nlinks) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_NLINKS_C'::h5pget_nlinks_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_NLINKS_C'::h5pget_nlinks_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: lapl_id INTEGER(SIZE_T), INTENT(OUT) :: nlinks END FUNCTION h5pget_nlinks_c @@ -7022,9 +7022,9 @@ INTERFACE INTEGER FUNCTION h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CREATE_INTER_GROUP_C'::h5pget_create_inter_group_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CREATE_INTER_GROUP_C'::h5pget_create_inter_group_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: lcpl_id INTEGER, INTENT(IN) :: crt_intermed_group END FUNCTION h5pget_create_inter_group_c @@ -7034,6 +7034,124 @@ END SUBROUTINE h5pget_create_inter_group_f +!---------------------------------------------------------------------- +! Name: H5Pset_chunk_cache_f +! +! Purpose: Set the number of objects in the meta data cache and the +! maximum number of chunks and bytes in the raw data chunk cache. +! Once set, these values will override the values in the file access +! property list. Each of these values can be individually unset +! (or not set at all) by passing the macros: +! H5D_CHUNK_CACHE_NSLOTS_DFLT_F, +! H5D_CHUNK_CACHE_NBYTES_DFLT_F, and/or +! H5D_CHUNK_CACHE_W0_DFLT_F +! as appropriate. +! +! The RDCC_W0 value should be between 0 and 1 inclusive and +! indicates how much chunks that have been fully read or fully +! written are favored for preemption. A value of zero means +! fully read or written 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. +! +! Inputs: +! dapl_id - Link creation property list identifier +! rdcc_nslots - +! rdcc_nbytes - +! rdcc_w0 - +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: M.S. Breitenfeld +! April 13, 2009 +! +! Modifications: +!-------------------------------------------------------------------------------------- + + SUBROUTINE h5pset_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dapl_id + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes + REAL, INTENT(IN) :: rdcc_w0 + INTEGER, INTENT(OUT) :: hdferr + + + INTERFACE + INTEGER FUNCTION h5pset_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHUNK_CACHE_C'::h5pset_chunk_cache_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: dapl_id + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes + REAL, INTENT(IN) :: rdcc_w0 + END FUNCTION h5pset_chunk_cache_c + END INTERFACE + + hdferr = h5pset_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) + + END SUBROUTINE h5pset_chunk_cache_f + +!---------------------------------------------------------------------- +! Name: H5Pget_chunk_cache_f +! +! Purpose: Retrieves the maximum possible number of elements in the meta +! data cache and the maximum possible number of elements and +! bytes and the RDCC_W0 value in the raw data chunk cache. Any +! (or all) arguments may be null pointers in which case the +! corresponding datum is not returned. If these properties have +! not been set on this property list, the default values for a +! file access property list are returned. +! +! Inputs: +! dapl_id - Link creation property list identifier +! rdcc_nslots - +! rdcc_nbytes - +! rdcc_w0 - +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: M.S. Breitenfeld +! April 13, 2009 +! +! Modifications: +!-------------------------------------------------------------------------------------- + + SUBROUTINE h5pget_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dapl_id + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes + REAL, INTENT(OUT) :: rdcc_w0 + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER FUNCTION h5pget_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHUNK_CACHE_C'::h5pget_chunk_cache_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: dapl_id + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes + REAL, INTENT(OUT) :: rdcc_w0 + END FUNCTION h5pget_chunk_cache_c + END INTERFACE + + hdferr = h5pget_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) + + END SUBROUTINE h5pget_chunk_cache_f END MODULE H5P diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 index 57843b7..f8ffb2f 100644 --- a/fortran/src/H5Rff.f90 +++ b/fortran/src/H5Rff.f90 @@ -111,9 +111,9 @@ INTERFACE INTEGER FUNCTION h5rcreate_object_c(ref_f, loc_id, name, namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RCREATE_OBJECT_C':: h5rcreate_object_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RCREATE_OBJECT_C':: h5rcreate_object_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HADDR_T) :: ref_f INTEGER(HID_T), INTENT(IN) :: loc_id @@ -175,9 +175,9 @@ INTERFACE INTEGER FUNCTION h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RCREATE_REGION_C':: h5rcreate_region_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RCREATE_REGION_C':: h5rcreate_region_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 INTEGER :: ref_f(REF_REG_BUF_LEN) @@ -239,9 +239,9 @@ INTERFACE INTEGER FUNCTION h5rdereference_object_c(dset_id, ref_f, obj_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RDEREFERENCE_OBJECT_C':: h5rdereference_object_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RDEREFERENCE_OBJECT_C':: h5rdereference_object_c + !DEC$ENDIF ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HADDR_T) :: ref_f @@ -298,9 +298,9 @@ INTERFACE INTEGER FUNCTION h5rdereference_region_c(dset_id, ref_f, obj_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RDEREFERENCE_REGION_C':: h5rdereference_region_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RDEREFERENCE_REGION_C':: h5rdereference_region_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 INTEGER :: ref_f(REF_REG_BUF_LEN) @@ -357,9 +357,9 @@ INTERFACE INTEGER FUNCTION h5rget_region_region_c(dset_id, ref_f, space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RGET_REGION_REGION_C':: h5rget_region_region_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_REGION_REGION_C':: h5rget_region_region_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 INTEGER :: ref_f(REF_REG_BUF_LEN) @@ -427,9 +427,9 @@ INTERFACE INTEGER FUNCTION h5rget_object_type_obj_c(dset_id, ref_f, obj_type) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RGET_OBJECT_TYPE_OBJ_C':: h5rget_object_type_obj_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_OBJECT_TYPE_OBJ_C':: h5rget_object_type_obj_c + !DEC$ENDIF ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HADDR_T) :: ref_f @@ -486,9 +486,9 @@ INTERFACE INTEGER FUNCTION h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_OBJECT_C':: h5rget_name_object_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_OBJECT_C':: h5rget_name_object_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id INTEGER(SIZE_T) :: size_default @@ -552,9 +552,9 @@ INTERFACE INTEGER FUNCTION h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_REGION_C':: h5rget_name_region_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_REGION_C':: h5rget_name_region_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: loc_id INTEGER(SIZE_T) :: size_default diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 index e6b93f5..7cabb00 100644 --- a/fortran/src/H5Sff.f90 +++ b/fortran/src/H5Sff.f90 @@ -67,9 +67,9 @@ INTERFACE INTEGER FUNCTION h5screate_simple_c(rank, dims, maxdims, space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SCREATE_SIMPLE_C'::h5screate_simple_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCREATE_SIMPLE_C'::h5screate_simple_c + !DEC$ENDIF INTEGER, INTENT(IN) :: rank INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) INTEGER(HSIZE_T), DIMENSION(:),INTENT(IN) :: maxdims(rank) @@ -127,9 +127,9 @@ INTERFACE INTEGER FUNCTION h5sclose_c(space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SCLOSE_C'::h5sclose_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCLOSE_C'::h5sclose_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id END FUNCTION h5sclose_c END INTERFACE @@ -180,9 +180,9 @@ INTERFACE INTEGER FUNCTION h5screate_c(classtype, space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SCREATE_C'::h5screate_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCREATE_C'::h5screate_c + !DEC$ENDIF INTEGER, INTENT(IN) :: classtype INTEGER(HID_T), INTENT(OUT) :: space_id END FUNCTION h5screate_c @@ -230,9 +230,9 @@ INTERFACE INTEGER FUNCTION h5scopy_c(space_id, new_space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SCOPY_C'::h5scopy_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOPY_C'::h5scopy_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HID_T), INTENT(OUT):: new_space_id END FUNCTION h5scopy_c @@ -282,9 +282,9 @@ INTERFACE INTEGER FUNCTION h5sget_select_hyper_nblocks_c (space_id, num_blocks) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_HYPER_NBLOCKS_C'::h5sget_select_hyper_nblocks_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) +!DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_HYPER_NBLOCKS_C'::h5sget_select_hyper_nblocks_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks END FUNCTION h5sget_select_hyper_nblocks_c @@ -343,9 +343,9 @@ INTEGER FUNCTION h5sget_select_hyper_blocklist_c(space_id, startblock, & num_blocks, buf ) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_HYPER_BLOCKLIST_C'::h5sget_select_hyper_blocklist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_HYPER_BLOCKLIST_C'::h5sget_select_hyper_blocklist_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), INTENT(IN) :: startblock INTEGER(HSIZE_T), INTENT(IN) :: num_blocks @@ -400,9 +400,9 @@ INTERFACE INTEGER FUNCTION h5sget_select_bounds_c(space_id, start, END) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_BOUNDS_C'::h5sget_select_bounds_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_BOUNDS_C'::h5sget_select_bounds_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END @@ -453,9 +453,9 @@ INTERFACE INTEGER FUNCTION h5sget_select_elem_npoints_c (space_id, num_points) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_ELEM_NPOINTS_C'::h5sget_select_elem_npoints_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) +!DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_ELEM_NPOINTS_C'::h5sget_select_elem_npoints_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSSIZE_T), INTENT(OUT) :: num_points END FUNCTION h5sget_select_elem_npoints_c @@ -508,9 +508,9 @@ INTEGER FUNCTION h5sget_select_elem_pointlist_c(space_id, startpoint, & num_points, buf ) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_ELEM_POINTLIST_C'::h5sget_select_elem_pointlist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) +!DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_ELEM_POINTLIST_C'::h5sget_select_elem_pointlist_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), INTENT(IN) :: startpoint INTEGER(HSIZE_T), INTENT(IN) :: num_points @@ -570,15 +570,15 @@ ! coord(rank, num_elements) INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:,:) :: c_coord - INTEGER :: error, i,j + INTEGER :: error, i INTERFACE INTEGER FUNCTION h5sselect_elements_c(space_id, OPERATOR,& num_elements,c_c_coord) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_ELEMENTS_C'::h5sselect_elements_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_ELEMENTS_C'::h5sselect_elements_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER, INTENT(IN) :: OPERATOR INTEGER(SIZE_T), INTENT(IN) :: num_elements @@ -636,9 +636,9 @@ INTERFACE INTEGER FUNCTION h5sselect_all_c(space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_ALL_C'::h5sselect_all_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_ALL_C'::h5sselect_all_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id END FUNCTION h5sselect_all_c END INTERFACE @@ -683,9 +683,9 @@ INTERFACE INTEGER FUNCTION h5sselect_none_c(space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_NONE_C'::h5sselect_none_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_NONE_C'::h5sselect_none_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id END FUNCTION h5sselect_none_c END INTERFACE @@ -734,9 +734,9 @@ INTERFACE INTEGER FUNCTION h5sselect_valid_c(space_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_VALID_C'::h5sselect_valid_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_VALID_C'::h5sselect_valid_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER :: flag END FUNCTION h5sselect_valid_c @@ -786,9 +786,9 @@ INTERFACE INTEGER FUNCTION h5sget_simple_extent_npoints_c( space_id, npoints) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_NPOINTS_C'::h5sget_simple_extent_npoints_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_NPOINTS_C'::h5sget_simple_extent_npoints_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), INTENT(OUT) :: npoints END FUNCTION h5sget_simple_extent_npoints_c @@ -836,9 +836,9 @@ INTERFACE INTEGER FUNCTION h5sget_select_npoints_c(space_id, npoints) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_NPOINTS_C'::h5sget_select_npoints_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_NPOINTS_C'::h5sget_select_npoints_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSSIZE_T), INTENT(OUT) :: npoints END FUNCTION h5sget_select_npoints_c @@ -885,9 +885,9 @@ INTERFACE INTEGER FUNCTION h5sget_simple_extent_ndims_c(space_id, rank) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_NDIMS_C'::h5sget_simple_extent_ndims_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_NDIMS_C'::h5sget_simple_extent_ndims_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER, INTENT(OUT) :: rank END FUNCTION h5sget_simple_extent_ndims_c @@ -942,9 +942,9 @@ INTERFACE INTEGER FUNCTION h5sget_simple_extent_dims_c(space_id, dims, maxdims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_DIMS_C'::h5sget_simple_extent_dims_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_DIMS_C'::h5sget_simple_extent_dims_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims @@ -1001,9 +1001,9 @@ INTERFACE INTEGER FUNCTION h5sget_simple_extent_type_c(space_id, classtype) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_TYPE_C'::h5sget_simple_extent_type_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_TYPE_C'::h5sget_simple_extent_type_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER, INTENT(OUT) :: classtype END FUNCTION h5sget_simple_extent_type_c @@ -1062,9 +1062,9 @@ INTEGER FUNCTION h5sset_extent_simple_c(space_id, rank, & current_size, maximum_size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SSET_EXTENT_SIMPLE_C'::h5sset_extent_simple_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSET_EXTENT_SIMPLE_C'::h5sset_extent_simple_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER, INTENT(IN) :: rank INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size @@ -1118,9 +1118,9 @@ INTERFACE INTEGER FUNCTION h5sis_simple_c(space_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SIS_SIMPLE_C'::h5sis_simple_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SIS_SIMPLE_C'::h5sis_simple_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER :: flag END FUNCTION h5sis_simple_c @@ -1171,9 +1171,9 @@ INTERFACE INTEGER FUNCTION h5soffset_simple_c(space_id, offset) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SOFFSET_SIMPLE_C'::h5soffset_simple_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SOFFSET_SIMPLE_C'::h5soffset_simple_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset END FUNCTION h5soffset_simple_c @@ -1224,9 +1224,9 @@ INTERFACE INTEGER FUNCTION h5sextent_copy_c(dest_space_id, source_space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_COPY_C'::h5sextent_copy_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_COPY_C'::h5sextent_copy_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dest_space_id INTEGER(HID_T), INTENT(IN) :: source_space_id END FUNCTION h5sextent_copy_c @@ -1270,9 +1270,9 @@ INTERFACE INTEGER FUNCTION h5sset_extent_none_c(space_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SSET_EXTENT_NONE_C'::h5sset_extent_none_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSET_EXTENT_NONE_C'::h5sset_extent_none_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id END FUNCTION h5sset_extent_none_c END INTERFACE @@ -1344,9 +1344,9 @@ INTEGER FUNCTION h5sselect_hyperslab_c(space_id, operator, & start, count, stride, block) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_HYPERSLAB_C'::h5sselect_hyperslab_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_HYPERSLAB_C'::h5sselect_hyperslab_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER, INTENT(IN) :: operator INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start @@ -1482,9 +1482,9 @@ ! INTEGER FUNCTION h5scombine_hyperslab_c(space_id, operator, & ! start, count, stride, block, hyper_id) ! USE H5GLOBAL -! !DEC$ IF DEFINED(HDF5F90_WINDOWS) -! !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_HYPERSLAB_C'::h5scombine_hyperslab_c -! !DEC$ ENDIF +! !DEC$IF DEFINED(HDF5F90_WINDOWS) +! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_HYPERSLAB_C'::h5scombine_hyperslab_c +! !DEC$ENDIF ! INTEGER(HID_T), INTENT(IN) :: space_id ! INTEGER, INTENT(IN) :: operator ! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start @@ -1605,9 +1605,9 @@ ! INTEGER FUNCTION h5scombine_select_c(space1_id, operator, & ! space2_id, ds_id) ! USE H5GLOBAL -! !DEC$ IF DEFINED(HDF5F90_WINDOWS) -! !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_SELECT_C'::h5scombine_select_c -! !DEC$ ENDIF +! !DEC$IF DEFINED(HDF5F90_WINDOWS) +! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_SELECT_C'::h5scombine_select_c +! !DEC$ENDIF ! INTEGER(HID_T), INTENT(IN) :: space1_id ! INTEGER(HID_T), INTENT(IN) :: space2_id ! INTEGER, INTENT(IN) :: operator @@ -1678,9 +1678,9 @@ ! INTEGER FUNCTION h5sselect_select_c(space1_id, operator, & ! space2_id) ! USE H5GLOBAL -! !DEC$ IF DEFINED(HDF5F90_WINDOWS) -! !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_SELECT_C'::h5sselect_select_c -! !DEC$ ENDIF +! !DEC$IF DEFINED(HDF5F90_WINDOWS) +! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_SELECT_C'::h5sselect_select_c +! !DEC$ENDIF ! INTEGER(HID_T), INTENT(INOUT) :: space1_id ! INTEGER(HID_T), INTENT(IN) :: space2_id ! INTEGER, INTENT(IN) :: operator @@ -1733,9 +1733,9 @@ INTERFACE INTEGER FUNCTION h5sget_select_type_c(space_id, type) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_TYPE_C'::h5sget_select_type_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_TYPE_C'::h5sget_select_type_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space_id INTEGER, INTENT(OUT) :: type END FUNCTION h5sget_select_type_c @@ -1778,9 +1778,9 @@ INTERFACE INTEGER FUNCTION h5sdecode_c(buf, obj_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SDECODE_C'::h5sdecode_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SDECODE_C'::h5sdecode_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf CHARACTER(LEN=*), INTENT(IN) :: buf INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID @@ -1827,9 +1827,9 @@ INTERFACE INTEGER FUNCTION h5sencode_c(buf, obj_id, nalloc) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SENCODE_C'::h5sencode_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SENCODE_C'::h5sencode_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(OUT) :: buf @@ -1878,9 +1878,9 @@ INTERFACE INTEGER FUNCTION h5sextent_equal_c(space1_id, space2_id, c_equal) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_EQUAL_C'::h5sextent_equal_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_EQUAL_C'::h5sextent_equal_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: space1_id INTEGER(HID_T), INTENT(IN) :: space2_id INTEGER(HID_T) :: c_equal diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 index 4849f0e..2e981ad 100644 --- a/fortran/src/H5Tff.f90 +++ b/fortran/src/H5Tff.f90 @@ -67,9 +67,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TOPEN_C'::h5topen_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TOPEN_C'::h5topen_c + !DEC$ENDIF !DEC$ATTRIBUTES reference ::name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -147,9 +147,9 @@ CONTAINS INTEGER FUNCTION h5tcommit_c(loc_id, name, namelen, type_id, & lcpl_id_default, tcpl_id_default, tapl_id_default ) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_C'::h5tcommit_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_C'::h5tcommit_c + !DEC$ENDIF !DEC$ATTRIBUTES reference ::name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -215,9 +215,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tcopy_c(type_id, new_type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOPY_C'::h5tcopy_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOPY_C'::h5tcopy_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(HID_T), INTENT(OUT) :: new_type_id END FUNCTION h5tcopy_c @@ -268,9 +268,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tequal_c(type1_id, type2_id, c_flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TEQUAL_C'::h5tequal_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TEQUAL_C'::h5tequal_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type1_id INTEGER(HID_T), INTENT(IN) :: type2_id INTEGER :: c_flag @@ -318,9 +318,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tclose_c(type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCLOSE_C'::h5tclose_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCLOSE_C'::h5tclose_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id END FUNCTION h5tclose_c END INTERFACE @@ -387,9 +387,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_class_c(type_id, class) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_CLASS_C'::h5tget_class_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_CLASS_C'::h5tget_class_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: class END FUNCTION h5tget_class_c @@ -436,9 +436,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_size_c(type_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_SIZE_C'::h5tget_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_SIZE_C'::h5tget_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(OUT) :: size END FUNCTION h5tget_size_c @@ -485,9 +485,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_size_c(type_id, size) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_SIZE_C'::h5tset_size_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_SIZE_C'::h5tset_size_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(IN) :: size END FUNCTION h5tset_size_c @@ -542,9 +542,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_order_c(type_id, order) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_ORDER_C'::h5tget_order_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_ORDER_C'::h5tget_order_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: order END FUNCTION h5tget_order_c @@ -599,9 +599,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_order_c(type_id, order) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_ORDER_C'::h5tset_order_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_ORDER_C'::h5tset_order_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: order END FUNCTION h5tset_order_c @@ -648,9 +648,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_precision_c (type_id, precision) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_PRECISION_C'::h5tget_precision_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_PRECISION_C'::h5tget_precision_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(OUT) :: precision END FUNCTION h5tget_precision_c @@ -696,9 +696,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_precision_c (type_id, precision) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_PRECISION_C'::h5tset_precision_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_PRECISION_C'::h5tset_precision_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(IN) :: precision END FUNCTION h5tset_precision_c @@ -745,9 +745,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_offset_c(type_id, offset) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_OFFSET_C'::h5tget_offset_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_OFFSET_C'::h5tget_offset_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(OUT) :: offset END FUNCTION h5tget_offset_c @@ -794,9 +794,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_offset_c(type_id, offset) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_OFFSET_C'::h5tset_offset_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_OFFSET_C'::h5tset_offset_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(IN) :: offset END FUNCTION h5tset_offset_c @@ -860,9 +860,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_pad_c(type_id, lsbpad, msbpad) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_PAD_C'::h5tget_pad_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_PAD_C'::h5tget_pad_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: lsbpad INTEGER, INTENT(OUT) :: msbpad @@ -926,9 +926,9 @@ CONTAINS INTEGER FUNCTION h5tset_pad_c(type_id, lsbpad, msbpad) USE H5GLOBAL INTEGER(HID_T), INTENT(IN) :: type_id - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_PAD_C'::h5tset_pad_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_PAD_C'::h5tset_pad_c + !DEC$ENDIF INTEGER, INTENT(IN) :: lsbpad INTEGER, INTENT(IN) :: msbpad END FUNCTION h5tset_pad_c @@ -984,9 +984,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_sign_c(type_id, sign) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_SIGN_C'::h5tget_sign_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_SIGN_C'::h5tget_sign_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: sign END FUNCTION h5tget_sign_c @@ -1042,9 +1042,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_sign_c(type_id, sign) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_SIGN_C'::h5tset_sign_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_SIGN_C'::h5tset_sign_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: sign END FUNCTION h5tset_sign_c @@ -1098,9 +1098,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_fields_c(type_id, spos, epos, esize, mpos, msize) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_FIELDS_C'::h5tget_fields_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_FIELDS_C'::h5tget_fields_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(OUT) :: spos INTEGER(SIZE_T), INTENT(OUT) :: epos @@ -1159,9 +1159,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_fields_c(type_id, spos, epos, esize, mpos, msize) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_FIELDS_C'::h5tset_fields_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_FIELDS_C'::h5tset_fields_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(IN) :: spos INTEGER(SIZE_T), INTENT(IN) :: epos @@ -1211,9 +1211,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_ebias_c(type_id, ebias) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_EBIAS_C'::h5tget_ebias_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_EBIAS_C'::h5tget_ebias_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(OUT) :: ebias END FUNCTION h5tget_ebias_c @@ -1260,9 +1260,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_ebias_c(type_id, ebias) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_EBIAS_C'::h5tset_ebias_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_EBIAS_C'::h5tset_ebias_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(IN) :: ebias END FUNCTION h5tset_ebias_c @@ -1317,9 +1317,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_norm_c(type_id, norm) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_NORM_C'::h5tget_norm_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_NORM_C'::h5tget_norm_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: norm END FUNCTION h5tget_norm_c @@ -1374,9 +1374,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_norm_c(type_id, norm) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_NORM_C'::h5tset_norm_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_NORM_C'::h5tset_norm_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: norm END FUNCTION h5tset_norm_c @@ -1433,9 +1433,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_inpad_c(type_id, padtype) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_INPAD_C'::h5tget_inpad_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_INPAD_C'::h5tget_inpad_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: padtype END FUNCTION h5tget_inpad_c @@ -1490,9 +1490,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_inpad_c(type_id, padtype) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_INPAD_C'::h5tset_inpad_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_INPAD_C'::h5tset_inpad_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: padtype END FUNCTION h5tset_inpad_c @@ -1542,9 +1542,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_cset_c(type_id, cset) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_CSET_C'::h5tget_cset_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_CSET_C'::h5tget_cset_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: cset END FUNCTION h5tget_cset_c @@ -1594,9 +1594,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_cset_c(type_id, cset) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_CSET_C'::h5tset_cset_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_CSET_C'::h5tset_cset_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: cset END FUNCTION h5tset_cset_c @@ -1647,9 +1647,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_strpad_c(type_id, strpad) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_STRPAD_C'::h5tget_strpad_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_STRPAD_C'::h5tget_strpad_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: strpad END FUNCTION h5tget_strpad_c @@ -1700,9 +1700,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_strpad_c(type_id, strpad) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_STRPAD_C'::h5tset_strpad_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_STRPAD_C'::h5tset_strpad_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: strpad END FUNCTION h5tset_strpad_c @@ -1749,9 +1749,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_nmembers_c(type_id, num_members) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_NMEMBERS_C'::h5tget_nmembers_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_NMEMBERS_C'::h5tget_nmembers_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: num_members END FUNCTION h5tget_nmembers_c @@ -1802,9 +1802,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_member_name_c(type_id, index, member_name, namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_NAME_C'::h5tget_member_name_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_NAME_C'::h5tget_member_name_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: member_name INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: index @@ -1856,9 +1856,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_member_offset_c(type_id, member_no, offset ) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_OFFSET_C'::h5tget_member_offset_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_OFFSET_C'::h5tget_member_offset_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: member_no INTEGER(SIZE_T), INTENT(OUT) :: offset @@ -1903,9 +1903,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_member_index_c(type_id, name, namelen, index) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_INDEX_C'::h5tget_member_index_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_INDEX_C'::h5tget_member_index_c + !DEC$ENDIF !DEC$ATTRIBUTES reference ::name INTEGER(HID_T), INTENT(IN) :: type_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -1999,9 +1999,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_array_dims_c(type_id, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_ARRAY_DIMS_C'::h5tget_array_dims_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_ARRAY_DIMS_C'::h5tget_array_dims_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) :: dims END FUNCTION h5tget_array_dims_c @@ -2048,9 +2048,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_array_ndims_c(type_id, ndims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_ARRAY_NDIMS_C'::h5tget_array_ndims_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_ARRAY_NDIMS_C'::h5tget_array_ndims_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: ndims END FUNCTION h5tget_array_ndims_c @@ -2098,9 +2098,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_super_c(type_id, base_type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_SUPER_C'::h5tget_super_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_SUPER_C'::h5tget_super_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(HID_T), INTENT(OUT) :: base_type_id END FUNCTION h5tget_super_c @@ -2151,9 +2151,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_member_type_c(type_id, field_idx , datatype) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_TYPE_C'::h5tget_member_type_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_TYPE_C'::h5tget_member_type_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: field_idx INTEGER(HID_T), INTENT(OUT) :: datatype @@ -2209,9 +2209,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tcreate_c(class, size, type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCREATE_C'::h5tcreate_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCREATE_C'::h5tcreate_c + !DEC$ENDIF INTEGER, INTENT(IN) :: class INTEGER(SIZE_T), INTENT(IN) :: size INTEGER(HID_T), INTENT(OUT) :: type_id @@ -2266,9 +2266,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tinsert_c(type_id, name, namelen, offset, field_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TINSERT_C'::h5tinsert_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TINSERT_C'::h5tinsert_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: type_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -2317,9 +2317,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tpack_c(type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TPACK_C'::h5tpack_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TPACK_C'::h5tpack_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id END FUNCTION h5tpack_c END INTERFACE @@ -2419,9 +2419,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tarray_create_c(base_id, rank, dims, type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TARRAY_CREATE_C'::h5tarray_create_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TARRAY_CREATE_C'::h5tarray_create_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: base_id INTEGER, INTENT(IN) :: rank INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims @@ -2474,9 +2474,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tenum_create_c(parent_id, new_type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TENUM_CREATE_C'::h5tenum_create_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_CREATE_C'::h5tenum_create_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: parent_id INTEGER(HID_T), INTENT(OUT) :: new_type_id END FUNCTION h5tenum_create_c @@ -2523,9 +2523,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tenum_insert_c(type_id, name, namelen, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TENUM_INSERT_C'::h5tenum_insert_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_INSERT_C'::h5tenum_insert_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: type_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -2580,9 +2580,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tenum_nameof_c(type_id, value, name, namelen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TENUM_NAMEOF_C'::h5tenum_nameof_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_NAMEOF_C'::h5tenum_nameof_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: type_id CHARACTER(LEN=*), INTENT(OUT) :: name @@ -2635,9 +2635,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tenum_valueof_c(type_id, name, namelen, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TENUM_VALUEOF_C'::h5tenum_valueof_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_VALUEOF_C'::h5tenum_valueof_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: type_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -2689,9 +2689,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_member_value_c(type_id, member_no, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_VALUE_C'::h5tget_member_value_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_VALUE_C'::h5tget_member_value_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: member_no INTEGER, INTENT(OUT) :: value @@ -2741,9 +2741,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tset_tag_c(type_id, tag, taglen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TSET_TAG_C'::h5tset_tag_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_TAG_C'::h5tset_tag_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: tag INTEGER(HID_T), INTENT(IN) :: type_id CHARACTER(LEN=*), INTENT(IN) :: tag @@ -2795,9 +2795,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_tag_c(type_id, tag, taglen) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_TAG_C'::h5tget_tag_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_TAG_C'::h5tget_tag_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: tag INTEGER(HID_T), INTENT(IN) :: type_id CHARACTER(LEN=*), INTENT(OUT) :: tag @@ -2840,9 +2840,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tvlen_create_c(type_id, vltype_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TVLEN_CREATE_C'::h5tvlen_create_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TVLEN_CREATE_C'::h5tvlen_create_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(HID_T), INTENT(OUT) :: vltype_id END FUNCTION h5tvlen_create_c @@ -2890,9 +2890,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tis_variable_str_c(type_id, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TIS_VARIABLE_STR_C'::h5tis_variable_str_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TIS_VARIABLE_STR_C'::h5tis_variable_str_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER :: flag END FUNCTION h5tis_variable_str_c @@ -2953,9 +2953,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_member_class_c(type_id, member_no, class) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_CLASS_C'::h5tget_member_class_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_CLASS_C'::h5tget_member_class_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(IN) :: member_no INTEGER, INTENT(OUT) :: class @@ -3017,9 +3017,9 @@ CONTAINS INTEGER FUNCTION h5tcommit_anon_c(loc_id, dtype_id, & tcpl_id_default, tapl_id_default) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_ANON_C'::h5tcommit_anon_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_ANON_C'::h5tcommit_anon_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: loc_id INTEGER(HID_T), INTENT(IN) :: dtype_id INTEGER(HID_T) :: tcpl_id_default @@ -3076,9 +3076,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tcommitted_c(dtype_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMMITTED_C'::h5tcommitted_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOMMITTED_C'::h5tcommitted_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dtype_id END FUNCTION h5tcommitted_c END INTERFACE @@ -3129,9 +3129,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tdecode_c(buf, obj_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TDECODE_C'::h5tdecode_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TDECODE_C'::h5tdecode_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf CHARACTER(LEN=*), INTENT(IN) :: buf INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID @@ -3178,9 +3178,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tencode_c(buf, obj_id, nalloc) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TENCODE_C'::h5tencode_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENCODE_C'::h5tencode_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: buf INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(OUT) :: buf @@ -3226,9 +3226,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_create_plist_c(dtype_id, dtpl_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_CREATE_PLIST_C'::h5tget_create_plist_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_CREATE_PLIST_C'::h5tget_create_plist_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dtype_id INTEGER(HID_T), INTENT(OUT) :: dtpl_id END FUNCTION h5tget_create_plist_c @@ -3272,9 +3272,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tcompiler_conv_c(src_id, dst_id, c_flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMPILER_CONV_C'::h5tcompiler_conv_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOMPILER_CONV_C'::h5tcompiler_conv_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: src_id INTEGER(HID_T), INTENT(IN) :: dst_id INTEGER :: c_flag @@ -3329,9 +3329,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5tget_native_type_c(dtype_id, direction, native_dtype_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_NATIVE_TYPE_C'::h5tget_native_type_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_NATIVE_TYPE_C'::h5tget_native_type_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dtype_id INTEGER, INTENT(IN) :: direction INTEGER(HID_T), INTENT(OUT) :: native_dtype_id diff --git a/fortran/src/H5Zff.f90 b/fortran/src/H5Zff.f90 index 343f680..7465db5 100644 --- a/fortran/src/H5Zff.f90 +++ b/fortran/src/H5Zff.f90 @@ -56,9 +56,9 @@ INTERFACE INTEGER FUNCTION h5zunregister_c (filter) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ZUNREGISTER_C':: h5zunregister_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ZUNREGISTER_C':: h5zunregister_c + !DEC$ENDIF INTEGER, INTENT(IN) :: filter END FUNCTION h5zunregister_c END INTERFACE @@ -104,9 +104,9 @@ INTERFACE INTEGER FUNCTION h5zfilter_avail_c(filter, flag) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ZFILTER_AVAIL_C'::h5zfilter_avail_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ZFILTER_AVAIL_C'::h5zfilter_avail_c + !DEC$ENDIF INTEGER, INTENT(IN) :: filter INTEGER :: flag END FUNCTION h5zfilter_avail_c @@ -161,9 +161,9 @@ INTERFACE INTEGER FUNCTION h5zget_filter_info_c(filter, config_flags) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ZGET_FILTER_INFO_C'::h5zget_filter_info_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ZGET_FILTER_INFO_C'::h5zget_filter_info_c + !DEC$ENDIF INTEGER, INTENT(IN) :: filter INTEGER, INTENT(OUT) :: config_flags END FUNCTION h5zget_filter_info_c diff --git a/fortran/src/H5_DBLE_InterfaceInclude.f90 b/fortran/src/H5_DBLE_InterfaceInclude.f90 index 0fdd63c..45bb237 100644 --- a/fortran/src/H5_DBLE_InterfaceInclude.f90 +++ b/fortran/src/H5_DBLE_InterfaceInclude.f90 @@ -138,9 +138,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_double_s_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_S_C'::h5awrite_double_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_S_C'::h5awrite_double_s_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -167,9 +167,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_double_1_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_1_C'::h5awrite_double_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_1_C'::h5awrite_double_1_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -199,9 +199,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_double_2_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_2_C'::h5awrite_double_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_2_C'::h5awrite_double_2_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -231,9 +231,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_double_3_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_3_C'::h5awrite_double_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_3_C'::h5awrite_double_3_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -263,9 +263,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_double_4_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_4_C'::h5awrite_double_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_4_C'::h5awrite_double_4_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -295,9 +295,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_double_5_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_5_C'::h5awrite_double_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_5_C'::h5awrite_double_5_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -327,9 +327,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_double_6_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_6_C'::h5awrite_double_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_6_C'::h5awrite_double_6_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -359,9 +359,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5awrite_double_7_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_7_C'::h5awrite_double_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_7_C'::h5awrite_double_7_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -389,9 +389,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_double_s_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_S_C'::h5aread_double_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_S_C'::h5aread_double_s_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -419,9 +419,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_double_1_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_1_C'::h5aread_double_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_1_C'::h5aread_double_1_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -451,9 +451,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_double_2_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_2_C'::h5aread_double_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_2_C'::h5aread_double_2_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -483,9 +483,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_double_3_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_3_C'::h5aread_double_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_3_C'::h5aread_double_3_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -515,9 +515,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_double_4_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_4_C'::h5aread_double_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_4_C'::h5aread_double_4_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -547,9 +547,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_double_5_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_5_C'::h5aread_double_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_5_C'::h5aread_double_5_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -579,9 +579,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_double_6_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_6_C'::h5aread_double_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_6_C'::h5aread_double_6_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -611,9 +611,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aread_double_7_c(attr_id, memtype_id, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_7_C'::h5aread_double_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_7_C'::h5aread_double_7_c + !DEC$ENDIF INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -657,9 +657,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_S_C'::h5dwrite_double_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_S_C'::h5dwrite_double_s_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -713,9 +713,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_1_C'::h5dwrite_double_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_1_C'::h5dwrite_double_1_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -770,9 +770,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_2_C'::h5dwrite_double_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_2_C'::h5dwrite_double_2_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -827,9 +827,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_3_C'::h5dwrite_double_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_3_C'::h5dwrite_double_3_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -884,9 +884,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_4_C'::h5dwrite_double_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_4_C'::h5dwrite_double_4_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -941,9 +941,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_5_C'::h5dwrite_double_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_5_C'::h5dwrite_double_5_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -999,9 +999,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_6_C'::h5dwrite_double_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_6_C'::h5dwrite_double_6_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1057,9 +1057,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_7_C'::h5dwrite_double_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_7_C'::h5dwrite_double_7_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1112,9 +1112,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_S_C'::h5dread_double_s_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_S_C'::h5dread_double_s_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1168,9 +1168,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_1_C'::h5dread_double_1_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_1_C'::h5dread_double_1_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1225,9 +1225,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_2_C'::h5dread_double_2_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_2_C'::h5dread_double_2_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1282,9 +1282,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_3_C'::h5dread_double_3_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_3_C'::h5dread_double_3_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1340,9 +1340,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_4_C'::h5dread_double_4_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_4_C'::h5dread_double_4_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1397,9 +1397,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_5_C'::h5dread_double_5_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_5_C'::h5dread_double_5_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1455,9 +1455,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_6_C'::h5dread_double_6_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_6_C'::h5dread_double_6_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1513,9 +1513,9 @@ CONTAINS file_space_id_default, & xfer_prp_default, buf, dims) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_7_C'::h5dread_double_7_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_7_C'::h5dread_double_7_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HID_T) :: mem_space_id_default @@ -1581,9 +1581,9 @@ CONTAINS INTEGER FUNCTION h5dfill_double_c(fill_value, fill_type_id, space_id, & buf, mem_type_id) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DFILL_DOUBLE_C'::h5dfill_double_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILL_DOUBLE_C'::h5dfill_double_c + !DEC$ENDIF DOUBLE PRECISION, INTENT(IN) :: fill_value ! Fill value INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier @@ -1620,9 +1620,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5pset_fill_value_double_c(prp_id, type_id, fillvalue) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_DOUBLE_C'::h5pset_fill_value_double_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_DOUBLE_C'::h5pset_fill_value_double_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(IN) :: type_id DOUBLE PRECISION, INTENT(IN) :: fillvalue @@ -1649,9 +1649,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5pget_fill_value_double_c(prp_id, type_id, fillvalue) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_DOUBLE_C'::h5pget_fill_value_double_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_DOUBLE_C'::h5pget_fill_value_double_c + !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(HID_T), INTENT(IN) :: type_id DOUBLE PRECISION :: fillvalue @@ -1697,9 +1697,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5pset_double_c(prp_id, name, name_len, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_DOUBLE_C'::h5pset_double_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_DOUBLE_C'::h5pset_double_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -1748,9 +1748,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5pget_double_c(prp_id, name, name_len, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_DOUBLE_C'::h5pget_double_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_DOUBLE_C'::h5pget_double_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -1803,9 +1803,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5pregister_double_c(class, name, name_len, size, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_DOUBLE_C'::h5pregister_double_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_DOUBLE_C'::h5pregister_double_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: class CHARACTER(LEN=*), INTENT(IN) :: name @@ -1857,9 +1857,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5pinsert_double_c(plist, name, name_len, size, value) USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_DOUBLE_C'::h5pinsert_double_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_DOUBLE_C'::h5pinsert_double_c + !DEC$ENDIF !DEC$ATTRIBUTES reference :: name INTEGER(HID_T), INTENT(IN) :: plist CHARACTER(LEN=*), INTENT(IN) :: name diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index d7bb3d8..a8b2d95 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -338,6 +338,9 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5d_flags[16] = (int_f)H5D_FILL_VALUE_UNDEFINED; h5d_flags[17] = (int_f)H5D_FILL_VALUE_DEFAULT; h5d_flags[18] = (int_f)H5D_FILL_VALUE_USER_DEFINED; + h5d_flags[19] = (int_f)H5D_CHUNK_CACHE_NSLOTS_DEFAULT; + h5d_flags[20] = (int_f)H5D_CHUNK_CACHE_NBYTES_DEFAULT; + h5d_flags[21] = (int_f)H5D_CHUNK_CACHE_W0_DEFAULT; /* * H5F flags diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 index 5a372b6..89360a3 100644 --- a/fortran/src/H5_ff.f90 +++ b/fortran/src/H5_ff.f90 @@ -54,9 +54,9 @@ CONTAINS ! INTERFACE INTEGER FUNCTION h5open_c() - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5OPEN_C'::h5open_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OPEN_C'::h5open_c + !DEC$ENDIF END FUNCTION h5open_c END INTERFACE INTERFACE @@ -65,9 +65,9 @@ CONTAINS INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5INIT_TYPES_C'::h5init_types_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5INIT_TYPES_C'::h5init_types_c + !DEC$ENDIF END FUNCTION h5init_types_c END INTERFACE INTERFACE @@ -102,18 +102,18 @@ CONTAINS INTEGER i_H5T_flags(H5T_FLAGS_LEN) INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5INIT_FLAGS_C'::h5init_flags_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5INIT_FLAGS_C'::h5init_flags_c + !DEC$ENDIF END FUNCTION h5init_flags_c END INTERFACE INTERFACE INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) USE H5GLOBAL INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5INIT1_FLAGS_C'::h5init1_flags_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5INIT1_FLAGS_C'::h5init1_flags_c + !DEC$ENDIF END FUNCTION h5init1_flags_c END INTERFACE error_0 = h5open_c() @@ -169,9 +169,9 @@ CONTAINS ! INTEGER, EXTERNAL :: h5close_types_c, h5close_c INTERFACE INTEGER FUNCTION h5close_c() - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_C'::h5close_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_C'::h5close_c + !DEC$ENDIF END FUNCTION h5close_c END INTERFACE INTERFACE @@ -185,9 +185,9 @@ CONTAINS INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_TYPES_C'::h5close_types_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_TYPES_C'::h5close_types_c + !DEC$ENDIF END FUNCTION h5close_types_c END INTERFACE error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & @@ -227,9 +227,9 @@ CONTAINS INTEGER, INTENT(OUT) :: majnum, minnum, relnum, error INTERFACE INTEGER FUNCTION h5get_libversion_c(majnum, minnum, relnum) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GET_LIBVERSION_C'::h5get_libversion_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GET_LIBVERSION_C'::h5get_libversion_c + !DEC$ENDIF INTEGER, INTENT(OUT) :: majnum, minnum, relnum END FUNCTION h5get_libversion_c END INTERFACE @@ -268,9 +268,9 @@ CONTAINS INTEGER, INTENT(OUT) :: error INTERFACE INTEGER FUNCTION h5check_version_c(majnum, minnum, relnum) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CHECK_VERSION_C'::h5check_version_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5CHECK_VERSION_C'::h5check_version_c + !DEC$ENDIF INTEGER, INTENT(IN) :: majnum, minnum, relnum END FUNCTION h5check_version_c END INTERFACE @@ -306,9 +306,9 @@ CONTAINS INTEGER, INTENT(OUT) :: error INTERFACE INTEGER FUNCTION h5garbage_collect_c() - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GARBAGE_COLLECT_C'::h5garbage_collect_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GARBAGE_COLLECT_C'::h5garbage_collect_c + !DEC$ENDIF END FUNCTION h5garbage_collect_c END INTERFACE @@ -343,9 +343,9 @@ CONTAINS INTEGER, INTENT(OUT) :: error INTERFACE INTEGER FUNCTION h5dont_atexit_c() - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DONT_ATEXIT_C'::h5dont_atexit_c - !DEC$ ENDIF + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DONT_ATEXIT_C'::h5dont_atexit_c + !DEC$ENDIF END FUNCTION h5dont_atexit_c END INTERFACE diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index c8e6649..e037d12 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -158,7 +158,7 @@ MODULE H5GLOBAL ! H5T_STD_REF_OBJ, & ! H5T_STD_REF_DSETREG !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ + !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ !DEC$endif COMMON /PREDEFINED_TYPES/ predef_types @@ -167,7 +167,7 @@ MODULE H5GLOBAL ! H5T_IEEE_F64BE, & ! H5T_IEEE_F64LE !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ + !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ !DEC$endif COMMON /FLOATING_TYPES/ floating_types ! @@ -188,7 +188,7 @@ MODULE H5GLOBAL ! H5T_STD_U64BE, & ! H5T_STD_U64LE !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ + !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ !DEC$endif COMMON /INTEGER_TYPES/ integer_types ! @@ -202,7 +202,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 INTEGER H5F_flags(H5F_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ !DEC$endif COMMON /H5F_FLAGS/ H5F_flags @@ -249,7 +249,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 INTEGER H5generic_flags(H5generic_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ !DEC$endif COMMON /H5generic_FLAGS/ H5generic_flags @@ -280,7 +280,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 INTEGER H5G_flags(H5G_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ !DEC$endif COMMON /H5G_FLAGS/ H5G_flags @@ -317,10 +317,10 @@ MODULE H5GLOBAL ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 19 + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 22 INTEGER H5D_flags(H5D_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ !DEC$endif COMMON /H5D_FLAGS/ H5D_flags @@ -348,6 +348,13 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F +! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 +! characters for variable names in Fortran. + + INTEGER :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F + EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) @@ -370,7 +377,11 @@ MODULE H5GLOBAL EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) - EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) + EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) + + EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) + EQUIVALENCE(H5D_flags(21), H5D_CHUNK_CACHE_NBYTES_DFLT_F) + EQUIVALENCE(H5D_flags(22), H5D_CHUNK_CACHE_W0_DFLT_F) ! ! H5FD flags declaration @@ -378,7 +389,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 INTEGER H5FD_flags(H5FD_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ !DEC$endif COMMON /H5FD_FLAGS/ H5FD_flags @@ -411,7 +422,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 INTEGER(HID_T) H5FD_hid_flags(H5FD_HID_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ !DEC$endif COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags @@ -437,7 +448,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 INTEGER H5I_flags(H5I_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ !DEC$endif COMMON /H5I_FLAGS/ H5I_flags @@ -470,7 +481,7 @@ MODULE H5GLOBAL INTEGER :: H5L_LINK_CLASS_T_VERS_F !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ !DEC$endif COMMON /H5L_FLAGS/ H5L_flags @@ -486,7 +497,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5O_FLAGS_LEN = 22 INTEGER :: H5o_flags(H5O_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ !DEC$endif COMMON /H5O_FLAGS/ H5O_flags @@ -542,7 +553,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ !DEC$endif COMMON /H5P_FLAGS/ H5P_flags @@ -590,7 +601,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 INTEGER H5P_flags_int(H5P_FLAGS_INT_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ !DEC$endif COMMON /H5P_FLAGS_INT/ H5P_flags_int INTEGER :: H5P_CRT_ORDER_INDEXED_F @@ -603,7 +614,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 INTEGER H5R_flags(H5R_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ !DEC$endif COMMON /H5R_FLAGS/ H5R_flags @@ -619,7 +630,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5S_FLAGS_LEN = 20 INTEGER H5S_flags(H5S_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ !DEC$endif COMMON /H5S_FLAGS/ H5S_flags @@ -679,7 +690,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5T_FLAGS_LEN = 33 INTEGER H5T_flags(H5T_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ !DEC$endif COMMON /H5T_FLAGS/ H5T_flags @@ -757,7 +768,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 14 INTEGER H5Z_flags(H5Z_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ !DEC$endif COMMON /H5Z_FLAGS/ H5Z_flags @@ -798,7 +809,7 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ !DEC$endif COMMON /H5LIB_FLAGS/ H5LIB_flags INTEGER :: H5_SZIP_EC_OM_F @@ -813,7 +824,7 @@ MODULE H5GLOBAL !!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 !!$ INTEGER H5_flags(H5_FLAGS_LEN) !!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ +!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ !!$!DEC$endif !!$ COMMON /H5_FLAGS/ H5_flags !!$ diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index b29af89..15dc41d 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -229,6 +229,7 @@ H5_FCDLL int_f nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid # define nh5dfill_double_c H5_FC_FUNC_(h5dfill_double_c, H5DFILL_DOUBLE_C) # define nh5dget_space_status_c H5_FC_FUNC_(h5dget_space_status_c, H5DGET_SPACE_STATUS_C) # define nh5dcreate_anon_c H5_FC_FUNC_(h5dcreate_anon_c, H5DCREATE_ANON_C) +# define nh5dget_access_plist_c H5_FC_FUNC_(h5dget_access_plist_c, H5DGET_ACCESS_PLIST_C) H5_FCDLL int_f nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, @@ -325,6 +326,8 @@ H5_FCDLL int_f nh5dreadc_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *m H5_FCDLL int_f nh5dreadc_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); H5_FCDLL int_f nh5dreadc_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); H5_FCDLL int_f nh5dreadc_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); +H5_FCDLL int_f nh5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id); + H5_FCDLL int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id); H5_FCDLL int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id); @@ -900,6 +903,8 @@ H5_FCDLL int_f nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, s # define nh5pset_scaleoffset_c H5_FC_FUNC_(h5pset_scaleoffset_c, H5PSET_SCALEOFFSET_C) # define nh5pset_nlinks_c H5_FC_FUNC_(h5pset_nlinks_c, H5PSET_NLINKS_C) # define nh5pget_nlinks_c H5_FC_FUNC_(h5pget_nlinks_c, H5PGET_NLINKS_C) +# define nh5pset_chunk_cache_c H5_FC_FUNC_(h5pset_chunk_cache_c, H5PSET_CHUNK_CACHE_C) +# define nh5pget_chunk_cache_c H5_FC_FUNC_(h5pget_chunk_cache_c, H5PGET_CHUNK_CACHE_C) H5_FCDLL int_f nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ); H5_FCDLL int_f nh5pclose_c ( hid_t_f *prp_id ); @@ -1056,6 +1061,8 @@ H5_FCDLL int_f nh5pset_nbit_c(hid_t_f *plist_id ); H5_FCDLL int_f nh5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor ); H5_FCDLL int_f nh5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); +H5_FCDLL int_f nh5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); +H5_FCDLL int_f nh5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); /* * Functions frome H5Rf.c */ @@ -1086,6 +1093,7 @@ H5_FCDLL int_f nh5rget_name_region_c (hid_t_f *loc_id, int_f *ref, _fcd name, si # define nh5idec_ref_c H5_FC_FUNC_(h5idec_ref_c, H5IDEC_REF_C) # define nh5iget_ref_c H5_FC_FUNC_(h5iget_ref_c, H5IGET_REF_C) # define nh5iget_file_id_c H5_FC_FUNC_(h5iget_file_id_c, H5IGET_FILE_ID_C) +# define nh5iis_valid_c H5_FC_FUNC_(h5iis_valid_c, H5IIS_VALID_C) H5_FCDLL int_f nh5iget_type_c(hid_t_f *obj_id, int_f *type); H5_FCDLL int_f nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size); @@ -1093,6 +1101,7 @@ H5_FCDLL int_f nh5iinc_ref_c(hid_t_f *obj_id, int_f *ref_count); H5_FCDLL int_f nh5idec_ref_c(hid_t_f *obj_id, int_f *ref_count); H5_FCDLL int_f nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count); H5_FCDLL int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id); +H5_FCDLL int_f nh5iis_valid_c(hid_t_f *obj_id, int_f *c_valid); /* * Functions from H5Ef.c diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 6275545..3a9c3f2 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -19,6 +19,7 @@ # include $(top_srcdir)/config/commence.am +include $(top_srcdir)/config/lt_vers.am # Include src directory in both Fortran and C flags (C compiler is used # for linking). @@ -30,6 +31,9 @@ AM_FCLIBS=$(LIBHDF5) # This is our main target, the fortran library lib_LTLIBRARIES=libhdf5_fortran.la +# Add libtool numbers to the HDF5 Fortran library (from config/lt_vers.am) +libhdf5_fortran_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + # Some Fortran compilers can't build shared libraries, so sometimes we # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index a61d929..5b80fa0 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -52,7 +52,8 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/h5fc.in $(top_srcdir)/config/commence.am \ - $(top_srcdir)/config/conclude.am + $(top_srcdir)/config/conclude.am \ + $(top_srcdir)/config/lt_vers.am noinst_PROGRAMS = H5match_types$(EXEEXT) H5fortran_detect$(EXEEXT) \ H5test_kind$(EXEEXT) TESTS = @@ -91,6 +92,9 @@ am_libhdf5_fortran_la_OBJECTS = H5f90global.lo H5fortran_types.lo \ H5Df.lo H5Ef.lo H5Ff.lo H5Gf.lo H5If.lo H5Lf.lo H5Of.lo \ H5Pf.lo H5Rf.lo H5Sf.lo H5Tf.lo H5Zf.lo $(am__objects_1) libhdf5_fortran_la_OBJECTS = $(am_libhdf5_fortran_la_OBJECTS) +libhdf5_fortran_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ + $(libhdf5_fortran_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(noinst_PROGRAMS) am_H5fortran_detect_OBJECTS = H5fortran_detect.$(OBJEXT) H5fortran_detect_OBJECTS = $(am_H5fortran_detect_OBJECTS) @@ -382,6 +386,12 @@ TRACE = perl $(top_srcdir)/bin/trace # *.clog are from the MPE option. CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# Add libtool shared library version numbers to the HDF5 library +# See libtool versioning documentation online. +LT_VERS_INTERFACE = 6 +LT_VERS_REVISION = 29 +LT_VERS_AGE = 0 + # Include src directory in both Fortran and C flags (C compiler is used # for linking). INCLUDES = -I$(top_srcdir)/src @@ -391,6 +401,9 @@ AM_FCLIBS = $(LIBHDF5) # This is our main target, the fortran library lib_LTLIBRARIES = libhdf5_fortran.la +# Add libtool numbers to the HDF5 Fortran library (from config/lt_vers.am) +libhdf5_fortran_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + # Some Fortran compilers can't build shared libraries, so sometimes we # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. @@ -472,12 +485,12 @@ all: $(BUILT_SOURCES) .SUFFIXES: .SUFFIXES: .c .f90 .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -531,7 +544,7 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libhdf5_fortran.la: $(libhdf5_fortran_la_OBJECTS) $(libhdf5_fortran_la_DEPENDENCIES) - $(FCLINK) -rpath $(libdir) $(libhdf5_fortran_la_OBJECTS) $(libhdf5_fortran_la_LIBADD) $(LIBS) + $(libhdf5_fortran_la_LINK) -rpath $(libdir) $(libhdf5_fortran_la_OBJECTS) $(libhdf5_fortran_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ @@ -626,7 +639,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -822,6 +835,19 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local help: @$(top_srcdir)/bin/makehelp +# 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. + # Fortran module files can have different extensions and different names # (e.g., different capitalizations) on different platforms. Write rules # for them explicitly rather than trying to teach automake about them. diff --git a/fortran/src/hdf5_fortrandll.def b/fortran/src/hdf5_fortrandll.def index 501570b..057dc13 100644 --- a/fortran/src/hdf5_fortrandll.def +++ b/fortran/src/hdf5_fortrandll.def @@ -199,6 +199,7 @@ H5D_mp_H5DSET_EXTENT_F H5D_mp_H5DGET_CREATE_PLIST_F H5D_mp_H5DGET_STORAGE_SIZE_F H5D_mp_H5DVLEN_GET_MAX_LEN_F +H5D_mp_H5DGET_ACCESS_PLIST_F ; H5E H5E_mp_H5ECLEAR_F H5E_mp_H5EPRINT_F @@ -268,6 +269,7 @@ H5I_mp_H5IINC_REF_F H5I_mp_H5IDEC_REF_F H5I_mp_H5IGET_REF_F H5I_mp_H5IGET_FILE_ID_F +H5I_mp_H5IIS_VALID_F ; H5L H5L_mp_H5LCOPY_F H5L_mp_H5LDELETE_F @@ -418,6 +420,8 @@ H5P_mp_H5PSET_SCALEOFFSET_F H5P_mp_H5PSET_NLINKS_F H5P_mp_H5PGET_NLINKS_F H5P_mp_H5PGET_CREATE_INTER_GROUP_F +H5P_mp_H5PSET_CHUNK_CACHE_F +H5P_mp_H5PGET_CHUNK_CACHE_F ; H5R H5R_mp_H5RCREATE_OBJECT_F H5R_mp_H5RCREATE_REGION_F diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 185db9b..f23efc4 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -442,8 +442,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -631,7 +631,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/fortran/test/fortranlib_test.f90 b/fortran/test/fortranlib_test.f90 index bbc6a25..742e98b 100644 --- a/fortran/test/fortranlib_test.f90 +++ b/fortran/test/fortranlib_test.f90 @@ -176,6 +176,9 @@ PROGRAM fortranlibtest CALL multi_file_test(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Multi file driver test', total_error) + CALL test_chunk_cache (cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error) + ! write(*,*) ! write(*,*) '=========================================' ! write(*,*) 'Testing ATTRIBUTE interface ' @@ -240,5 +243,3 @@ PROGRAM fortranlibtest IF (total_error .NE. 0) CALL h5_exit_f (1) END PROGRAM fortranlibtest - - diff --git a/fortran/test/fortranlib_test_1_8.f90 b/fortran/test/fortranlib_test_1_8.f90 index 49835b0..6158c16 100644 --- a/fortran/test/fortranlib_test_1_8.f90 +++ b/fortran/test/fortranlib_test_1_8.f90 @@ -92,6 +92,8 @@ PROGRAM fortranlibtest ' Testing dataspace encoding and decoding', & total_error) + + ! CALL test_hard_query(group_total_error) WRITE(*,*) diff --git a/fortran/test/tH5I.f90 b/fortran/test/tH5I.f90 index 1ef7ba2..c34bd09 100644 --- a/fortran/test/tH5I.f90 +++ b/fortran/test/tH5I.f90 @@ -60,6 +60,30 @@ INTEGER :: ref_count ! Reference count for IDs + INTEGER(hid_t) :: dtype ! datatype id + LOGICAL :: tri_ret ! value + + ! + ! Tests the function H5Iis_valid_f + ! + ! check that the ID is not valid + dtype = -1 + CALL H5Iis_valid_f(dtype, tri_ret, error) + CALL check("H5Iis_valid_f", error, total_error) + CALL VerifyLogical("H5Iis_valid_f", tri_ret, .FALSE., total_error) + + ! Create a datatype id + CALL H5Tcopy_f(H5T_NATIVE_INTEGER,dtype,error) + CALL check("H5Tcopy_f", error, total_error) + + ! Check that the ID is valid + CALL H5Iis_valid_f(dtype, tri_ret, error) + CALL check("H5Iis_valid_f", error, total_error) + CALL VerifyLogical("H5Tequal_f", tri_ret, .TRUE., total_error) + + CALL H5Tclose_f(dtype, error) + CALL check("H5Tclose_f", error, total_error) + ! ! Create a new file using default properties. ! diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90 index 7e6c8de..3063842 100644 --- a/fortran/test/tH5P.f90 +++ b/fortran/test/tH5P.f90 @@ -49,8 +49,6 @@ buf_size = 4*1024*1024 - - ! !Create file "external.h5" using default properties. ! @@ -395,3 +393,276 @@ RETURN END SUBROUTINE multi_file_test + +!------------------------------------------------------------------------- +! Function: test_chunk_cache +! +! Purpose: Tests APIs: +! H5P_H5PSET_CHUNK_CACHE_F +! H5P_H5PGET_CHUNK_CACHE_F +! H5D_H5DGET_ACCESS_PLIST_F +! +! Return: Success: 0 +! Failure: -1 +! +! C Programmer: Neil Fortner +! Wednesday, October 29, 2008 +! +! FORTRAN Programmer: M. Scot Breitenfeld +! April 16, 2009 +!------------------------------------------------------------------------- +! +SUBROUTINE test_chunk_cache(cleanup, total_error) + + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=14), PARAMETER :: filename="chunk_cache" + CHARACTER(LEN=80) :: fix_filename + INTEGER(hid_t) :: fid = -1 ! /* File ID */ + INTEGER(hid_t) :: file + INTEGER(hid_t) :: fapl_local = -1 ! /* Local fapl */ + INTEGER(hid_t) :: fapl_def = -1 ! /* Default fapl */ + INTEGER(hid_t) :: dcpl = -1 !/* Dataset creation property list ID */ + INTEGER(hid_t) :: dapl1 = -1 !/* Dataset access property list ID */ + INTEGER(hid_t) :: dapl2 = -1 !/* Dataset access property list ID */ + INTEGER(hid_t) :: sid = -1 !/* Dataspace ID */ + INTEGER(hid_t) :: dsid = -1 !/* Dataset ID */ + INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) !/* Dataset and chunk dimensions */ + INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 !/* rdcc number of elements */ + INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 !/* rdcc number of bytes */ + INTEGER :: mdc_nelmts + INTEGER(size_t) ::nlinks !/* Number of link traversals */ + REAL :: w0_1, w0_2, w0_3, w0_4; !/* rdcc preemption policy */ + INTEGER :: error + INTEGER(size_t) rdcc_nelmts + INTEGER(size_t) rdcc_nbytes + REAL :: rdcc_w0 + + + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + + !/* Create a default fapl and dapl */ + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_def, error) + CALL check("H5Pcreate_f", error, total_error) + CALL H5Pcreate_f(H5P_DATASET_ACCESS_F, dapl1, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Verify that H5Pget_chunk_cache(dapl) returns the same values as are in + ! the default fapl. + ! + CALL H5Pget_cache_f(fapl_def, mdc_nelmts, nslots_1, nbytes_1, w0_1, error) + CALL check("H5Pget_cache_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl1, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_1), INT(nslots_4), total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_1), INT(nbytes_4), total_error) + IF(w0_1.NE.w0_4)THEN + CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) + ENDIF + + ! /* Set a lapl property on dapl1 (to verify inheritance) */ + CALL H5Pset_nlinks_f(dapl1, 134_size_t , error) + CALL check("H5Pset_nlinks_f", error, total_error) + CALL H5Pget_nlinks_f(dapl1, nlinks, error) + CALL check("H5Pget_nlinks_f", error, total_error) + CALL VERIFY("H5Pget_nlinks_f", INT(nlinks), 134, total_error) + + + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_local, error) + CALL check("h5pcreate_f", error, total_error) + ! Turn off the chunk cache, so all the chunks are immediately written to disk + CALL H5Pget_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) + CALL check("H5Pget_cache_f", error, total_error) + rdcc_nbytes = 0; + CALL H5Pset_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) + CALL check("H5Pset_cache_f", error, total_error) + + ! Set new rdcc settings on fapl! + nslots_2 = nslots_1 * 2 + nbytes_2 = nbytes_1 * 2 + w0_2 = w0_1 / 2. + + CALL H5Pset_cache_f(fapl_local, 0, nslots_2, nbytes_2, w0_2, error) + CALL check("H5Pset_cache_f", error, total_error) + + !/* Create file */ + CALL H5Fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl_local) + CALL check("H5Fcreate_f", error, total_error) + + !/* Create dataset creation property list */ + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) + CALL check("H5Pcreate_f", error, total_error) + + !/* Set chunking */ + chunk_dim(1) = 10; + CALL H5Pset_chunk_f(dcpl, 1, chunk_dim, error) + CALL check("H5Pset_chunk_f", error, total_error) + + !/* Create 1-D dataspace */ + ndim(1) = 100 + CALL H5Screate_simple_f(1, ndim, sid, error) + CALL check("H5Pcreate_f", error, total_error) + + ! /* Create dataset with default dapl */ + CALL H5Dcreate_f(fid, "dset", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, dapl1) + CALL check("H5Pcreate_f", error, total_error) + + ! /* Retrieve dapl from dataset, verify cache values are the same as on fapl_local */ + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + IF(w0_2.NE.w0_4)THEN + CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) + ENDIF + CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + + ! Set new values on dapl1. nbytes will be set to default, so the file + ! property will override this setting + + nslots_3 = nslots_2 * 2 + nbytes_3 = H5D_CHUNK_CACHE_NBYTES_DFLT_F + w0_3 = w0_2 / 2 + + CALL H5Pset_chunk_cache_f(dapl1, nslots_3, nbytes_3, w0_3, error) + CALL check("H5Pset_chunk_cache_f", error, total_error) + + ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen */ + CALL H5Dclose_f(dsid, error) + CALL H5Oopen_f(fid, "dset", dsid, error, dapl1) + + ! Retrieve dapl from dataset, verfiy cache values are the same as on dapl1 + ! + ! Note we rely on the knowledge that H5Pget_chunk_cache retrieves these + ! values directly from the dataset structure, and not from a copy of the + ! dapl used to open the dataset (which is not preserved). + ! + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + IF(w0_3.NE.w0_4)THEN + CALL VERIFYlogical("H5Pget_chunk_cache_f4", .TRUE., .FALSE., total_error) + ENDIF + CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + + ! Close dataset, reopen with H5P_DEFAULT as dapl + CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Oopen_f(fid, "dset", dsid, error) + CALL check("H5Oopen_f", error, total_error) + + ! Retrieve dapl from dataset, verfiy cache values are the same as on fapl_local + + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + IF(w0_2.NE.w0_4)THEN + CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) + ENDIF + CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + + ! Similary, test use of H5Dcreate2 with H5P_DEFAULT + CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + + CALL H5Dcreate_f(fid, "dset2", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("H5Pcreate_f", error, total_error) + + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + IF(w0_2.NE.w0_4)THEN + CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) + ENDIF + ! Don't close dapl2, we will use it in the next section + + ! Modify cache values on fapl_local + nbytes_3 = nbytes_2 * 2 + + CALL H5Pset_cache_f(fapl_local, 0, nslots_3, nbytes_3, w0_3, error) + CALL check("H5Pset_cache_f", error, total_error) + + ! Close and reopen file with new fapl_local + + CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Fclose_f(fid,error); CALL check("h5fclose_f", error, total_error) + + CALL H5Fopen_f (fix_filename, H5F_ACC_RDWR_F, fid, error, fapl_local) + CALL check("h5fopen_f", error, total_error) + + ! Verify that dapl2 retrieved earlier (using values from the old fapl) + ! sets its values in the new file (test use of H5Dopen2 with a dapl) + ! + + CALL h5dopen_f (fid, "dset", dsid, error, dapl2) + CALL check("h5dopen_f", error, total_error) + + CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) ! Close dapl2, to avoid id leak + + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + IF(w0_2.NE.w0_4)THEN + CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) + ENDIF + + ! Test H5D_CHUNK_CACHE_NSLOTS_DEFAULT and H5D_CHUNK_CACHE_W0_DEFAULT + nslots_2 = H5D_CHUNK_CACHE_NSLOTS_DFLT_F + w0_2 = H5D_CHUNK_CACHE_W0_DFLT_F + + CALL H5Pset_chunk_cache_f(dapl2, nslots_2, nbytes_2, w0_2, error) + CALL check("H5Pset_chunk_cache_f", error, total_error) + + CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL h5dopen_f (fid, "dset", dsid, error, dapl2) + CALL check("h5dopen_f", error, total_error) + + CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) + CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + IF(w0_3.NE.w0_4)THEN + CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) + ENDIF + +! Close + + CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Sclose_f(sid,error); CALL check("H5Sclose_f", error, total_error) + CALL H5Pclose_f(fapl_local,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(fapl_def,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl1,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dcpl,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Fclose_f(fid,error); CALL check("H5Fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE test_chunk_cache + diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 14f4e7b..c0c475b 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -377,8 +377,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -439,7 +439,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/hl/Makefile.in b/hl/Makefile.in index 16a4a64..932ad0a 100755 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -353,8 +353,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -460,7 +460,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 9ce31d4..bd53be5 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -347,8 +347,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -454,7 +454,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index fa94108..07b8749 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -361,8 +361,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ diff --git a/hl/c++/src/Makefile.am b/hl/c++/src/Makefile.am index 8d2e869..1ff24be 100644 --- a/hl/c++/src/Makefile.am +++ b/hl/c++/src/Makefile.am @@ -19,6 +19,7 @@ # include $(top_srcdir)/config/commence.am +include $(top_srcdir)/config/lt_vers.am # Include src directory INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/hl/src @@ -26,6 +27,9 @@ INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/hl/src # This is our main target lib_LTLIBRARIES=libhdf5_hl_cpp.la +# Add libtool numbers to the HDF5 HL C++ library (from config/lt_vers.am) +libhdf5_hl_cpp_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + # Shared C++ libraries aren't universally supported. if CXX_SHARED_CONDITIONAL else diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 4e168ad..4e1cf8d 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -52,7 +52,8 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/config/commence.am \ - $(top_srcdir)/config/conclude.am + $(top_srcdir)/config/conclude.am \ + $(top_srcdir)/config/lt_vers.am TESTS = subdir = hl/c++/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -74,6 +75,9 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libhdf5_hl_cpp_la_LIBADD = am_libhdf5_hl_cpp_la_OBJECTS = H5PacketTable.lo libhdf5_hl_cpp_la_OBJECTS = $(am_libhdf5_hl_cpp_la_OBJECTS) +libhdf5_hl_cpp_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libhdf5_hl_cpp_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles @@ -342,12 +346,21 @@ TRACE = perl $(top_srcdir)/bin/trace # *.clog are from the MPE option. CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# Add libtool shared library version numbers to the HDF5 library +# See libtool versioning documentation online. +LT_VERS_INTERFACE = 6 +LT_VERS_REVISION = 29 +LT_VERS_AGE = 0 + # Include src directory INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src # This is our main target lib_LTLIBRARIES = libhdf5_hl_cpp.la +# Add libtool numbers to the HDF5 HL C++ library (from config/lt_vers.am) +libhdf5_hl_cpp_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + # Shared C++ libraries aren't universally supported. @CXX_SHARED_CONDITIONAL_FALSE@AM_LDFLAGS = -static @@ -377,12 +390,12 @@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -434,7 +447,7 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libhdf5_hl_cpp.la: $(libhdf5_hl_cpp_la_OBJECTS) $(libhdf5_hl_cpp_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(libhdf5_hl_cpp_la_OBJECTS) $(libhdf5_hl_cpp_la_LIBADD) $(LIBS) + $(libhdf5_hl_cpp_la_LINK) -rpath $(libdir) $(libhdf5_hl_cpp_la_OBJECTS) $(libhdf5_hl_cpp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -493,7 +506,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -682,6 +695,19 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES help: @$(top_srcdir)/bin/makehelp +# 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. + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 285d2e0..dd02c2a 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -373,8 +373,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -449,7 +449,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 3c90dd8..20b6197 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -368,8 +368,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index af080bb..c04a423 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -351,8 +351,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -458,7 +458,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 1de9302..3d9ba65 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -368,8 +368,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ diff --git a/hl/fortran/src/Makefile.am b/hl/fortran/src/Makefile.am index 6bf010b..fbc3908 100644 --- a/hl/fortran/src/Makefile.am +++ b/hl/fortran/src/Makefile.am @@ -20,6 +20,7 @@ # HDF5 High-Level Fortran Makefile(.in) include $(top_srcdir)/config/commence.am +include $(top_srcdir)/config/lt_vers.am INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src @@ -28,6 +29,9 @@ AM_FCFLAGS=-I$(top_builddir)/fortran/src $(F9XMODFLAG)$(top_builddir)/fortran/sr # Our main target, the high-level fortran library lib_LTLIBRARIES=libhdf5hl_fortran.la +# Add libtool numbers to the HDF5 HL Fortran library (from config/lt_vers.am) +libhdf5hl_fortran_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + # Some Fortran compilers can't build shared libraries, so sometimes we # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 4d4b6fc..8387e66 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -51,7 +51,8 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/commence.am \ - $(top_srcdir)/config/conclude.am + $(top_srcdir)/config/conclude.am \ + $(top_srcdir)/config/lt_vers.am TESTS = subdir = hl/fortran/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -74,6 +75,9 @@ libhdf5hl_fortran_la_LIBADD = am_libhdf5hl_fortran_la_OBJECTS = H5LTfc.lo H5IMfc.lo H5IMcc.lo \ H5TBfc.lo H5LTff.lo H5IMff.lo H5TBff.lo libhdf5hl_fortran_la_OBJECTS = $(am_libhdf5hl_fortran_la_OBJECTS) +libhdf5hl_fortran_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ + $(libhdf5hl_fortran_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles @@ -346,6 +350,12 @@ TRACE = perl $(top_srcdir)/bin/trace # .chklog files are output from those tests. # *.clog are from the MPE option. CHECK_CLEANFILES = *.chkexe *.chklog *.clog + +# Add libtool shared library version numbers to the HDF5 library +# See libtool versioning documentation online. +LT_VERS_INTERFACE = 6 +LT_VERS_REVISION = 29 +LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src @@ -354,6 +364,9 @@ AM_FCFLAGS = -I$(top_builddir)/fortran/src $(F9XMODFLAG)$(top_builddir)/fortran/ # Our main target, the high-level fortran library lib_LTLIBRARIES = libhdf5hl_fortran.la +# Add libtool numbers to the HDF5 HL Fortran library (from config/lt_vers.am) +libhdf5hl_fortran_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + # Some Fortran compilers can't build shared libraries, so sometimes we # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. @@ -386,12 +399,12 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .f90 .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -443,7 +456,7 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libhdf5hl_fortran.la: $(libhdf5hl_fortran_la_OBJECTS) $(libhdf5hl_fortran_la_DEPENDENCIES) - $(FCLINK) -rpath $(libdir) $(libhdf5hl_fortran_la_OBJECTS) $(libhdf5hl_fortran_la_LIBADD) $(LIBS) + $(libhdf5hl_fortran_la_LINK) -rpath $(libdir) $(libhdf5hl_fortran_la_OBJECTS) $(libhdf5hl_fortran_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -497,7 +510,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -687,6 +700,19 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local help: @$(top_srcdir)/bin/makehelp +# 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. + # Fortran module files can have different extensions and different names # (e.g., different capitalizations) on different platforms. Write rules # for them explicitly rather than trying to teach automake about them. diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 6958f34..0abae85 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -383,8 +383,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -451,7 +451,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 83bb1ed..9efa95e 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -142,13 +142,18 @@ herr_t H5DSattach_scale(hid_t did, H5I_type_t it1, it2; int i, len; int found_ds=0; + htri_t is_scale; /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- */ + + if ((is_scale = H5DSis_scale(did)) < 0) + return FAIL; + /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ( is_scale == 1) return FAIL; /* get info for the dataset in the parameter list */ @@ -477,7 +482,7 @@ herr_t H5DSattach_scale(hid_t did, nelmts++; - dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); + dsbuf = (ds_list_t*) malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; @@ -637,13 +642,18 @@ herr_t H5DSdetach_scale(hid_t did, H5O_info_t oi1, oi2, oi3, oi4; int found_dset = 0, found_ds = 0; H5I_type_t it1, it2; + htri_t is_scale; /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- */ + + if ((is_scale = H5DSis_scale(did)) < 0) + return FAIL; + /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ( is_scale == 1) return FAIL; /* get info for the dataset in the parameter list */ @@ -691,6 +701,9 @@ herr_t H5DSdetach_scale(hid_t did, if (H5Sclose(sid) < 0) return FAIL; + /* parameter range checking */ + if (idx>(unsigned)rank-1) + return FAIL; /*------------------------------------------------------------------------- * find "REFERENCE_LIST" @@ -749,13 +762,21 @@ herr_t H5DSdetach_scale(hid_t did, goto out; /* same object, reset */ - if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr) { + if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr) + { + size_t len; + for(jj=j; jj ((unsigned)rank - 1)) - goto out; + return FAIL; /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */ if((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0) @@ -1169,7 +1195,7 @@ htri_t H5DSis_attached(hid_t did, if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0) goto out; - dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); + dsbuf = (ds_list_t*) malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; @@ -1266,11 +1292,12 @@ out: * Parameters: * * hid_t DID; IN: the dataset -* unsigned int dim; IN: the dimension of the dataset -* int *idx; IN/OUT: input the index to start iterating, output the -* next index to visit. If NULL, start at the first position. -* H5DS_iterate_t visitor; IN: the visitor function -* void *visitor_data; IN: arbitrary data to pass to the visitor function. +* unsigned int DIM; IN: the dimension of the dataset +* int *DS_IDX; IN/OUT: on input the dimension scale index to start iterating, +* on output the next index to visit. If NULL, start at +* the first position. +* H5DS_iterate_t VISITOR; IN: the visitor function +* void *VISITOR_DATA; IN: arbitrary data to pass to the visitor function. * * Iterate over all scales of DIM, calling an application callback * with the item, key and any operator data. @@ -1298,7 +1325,7 @@ out: herr_t H5DSiterate_scales(hid_t did, unsigned int dim, - int *idx, + int *ds_idx, H5DS_iterate_t visitor, void *visitor_data ) { @@ -1331,6 +1358,13 @@ herr_t H5DSiterate_scales(hid_t did, if ((nscales = H5DSget_num_scales(did,dim)) < 0) return FAIL; + /* parameter range checking */ + if (ds_idx!=NULL) + { + if (*ds_idx>=nscales) + return FAIL; + } + /* get dataset space */ if ((sid = H5Dget_space(did)) < 0) return FAIL; @@ -1343,6 +1377,9 @@ herr_t H5DSiterate_scales(hid_t did, if(H5Sclose(sid) < 0) goto out; + if ( dim >= (unsigned)rank ) + return FAIL; + /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */ if((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0) return FAIL; @@ -1371,8 +1408,8 @@ herr_t H5DSiterate_scales(hid_t did, if ( buf[dim].len > 0 ) { - if (idx!=NULL) - j_idx = *idx; + if (ds_idx!=NULL) + j_idx = *ds_idx; else j_idx=0; @@ -1389,14 +1426,16 @@ herr_t H5DSiterate_scales(hid_t did, goto out; } H5E_END_TRY; - if((ret_value=(visitor)(did,dim,scale_id,visitor_data))!=0) + /* set the return IDX OUT value at current scale index */ + if (ds_idx!=NULL) { - /* set the return IDX OUT value at current scale index and break */ - if (idx!=NULL) - { - *idx = i; - } + *ds_idx = i; + } + if((ret_value=(visitor)(did,dim,scale_id,visitor_data))!=0) + { + /* break */ + /* close the DS id */ if (H5Dclose(scale_id) < 0) goto out; @@ -1462,16 +1501,17 @@ out: *------------------------------------------------------------------------- */ -herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { - int has_labels; - hid_t sid; /* space ID */ - hid_t tid = -1; /* attribute type ID */ - hid_t aid = -1; /* attribute ID */ - int rank; /* rank of dataset */ - hsize_t dims[1]; /* dimensions of dataset */ - const char **buf = NULL; /* buffer to store in the attribute */ - H5I_type_t it; /* ID type */ - unsigned int i; +herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) +{ + int has_labels; + hid_t sid = -1; /* space ID */ + hid_t tid = -1; /* attribute type ID */ + hid_t aid = -1; /* attribute ID */ + int rank; /* rank of dataset */ + hsize_t dims[1]; /* dimensions of dataset */ + const char **buf = NULL; /* buffer to store in the attribute */ + H5I_type_t it; /* ID type */ + unsigned int i; /*------------------------------------------------------------------------- * parameter checking @@ -1484,16 +1524,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { if (H5I_DATASET != it) return FAIL; - /*------------------------------------------------------------------------- - * attribute "DIMENSION_LABELS" - *------------------------------------------------------------------------- - */ - - /* try to find the attribute "DIMENSION_LABELS" on the >>data<< dataset */ - if ((has_labels = H5LT_find_attribute(did, DIMENSION_LABELS)) < 0) - return FAIL; - - /* get dataset space */ + /* get dataset space */ if ((sid = H5Dget_space(did)) < 0) return FAIL; @@ -1505,12 +1536,25 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { if (H5Sclose(sid) < 0) goto out; + if ( idx >= (unsigned)rank ) + return FAIL; + + /*------------------------------------------------------------------------- + * attribute "DIMENSION_LABELS" + *------------------------------------------------------------------------- + */ + + /* try to find the attribute "DIMENSION_LABELS" on the >>data<< dataset */ + if ((has_labels = H5LT_find_attribute(did, DIMENSION_LABELS)) < 0) + return FAIL; + /*------------------------------------------------------------------------- * make the attribute and insert label *------------------------------------------------------------------------- */ - if (has_labels == 0) { + if (has_labels == 0) + { dims[0] = rank; /* space for the attribute */ @@ -1524,8 +1568,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { goto out; /* create the attribute */ - if ((aid = H5Acreate2(did, DIMENSION_LABELS, tid, sid, - H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((aid = H5Acreate2(did, DIMENSION_LABELS, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* allocate and initialize */ @@ -1553,7 +1596,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { goto out; if (buf) { - free((void *) buf); + free(buf); buf = NULL; } } @@ -1563,7 +1606,8 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { *------------------------------------------------------------------------- */ - else { + else + { if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0) goto out; @@ -1595,7 +1639,8 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { buf[idx] = NULL; /* free all the ptr's from the H5Aread() */ - for (i = 0; i < (unsigned int) rank; i++) { + for (i = 0; i < (unsigned int) rank; i++) + { if (buf[i]) free(buf[i]); } @@ -1607,7 +1652,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { goto out; if (buf) { - free((void *) buf); + free(buf); buf = NULL; } } @@ -1616,11 +1661,13 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { /* error zone */ out: - if (buf) { + if (buf) + { if (buf[idx]) /* check if we errored during H5Awrite */ buf[idx] = NULL; /* don't free label */ /* free all the ptr's from the H5Aread() */ - for (i = 0; i < (unsigned int) rank; i++) { + for (i = 0; i < (unsigned int) rank; i++) + { if (buf[i]) free(buf[i]); } @@ -1656,17 +1703,18 @@ out: * *------------------------------------------------------------------------- */ -ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) { - int has_labels; - hid_t sid; /* space ID */ - hid_t tid = -1; /* attribute type ID */ - hid_t aid = -1; /* attribute ID */ - int rank; /* rank of dataset */ - char **buf = NULL; /* buffer to store in the attribute */ - H5I_type_t it; /* ID type */ - size_t nbytes; - size_t copy_len; - int i; +ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) +{ + int has_labels; + hid_t sid = -1; /* space ID */ + hid_t tid = -1; /* attribute type ID */ + hid_t aid = -1; /* attribute ID */ + int rank; /* rank of dataset */ + char **buf = NULL; /* buffer to store in the attribute */ + H5I_type_t it; /* ID type */ + size_t nbytes; + size_t copy_len; + int i; /*------------------------------------------------------------------------- * parameter checking @@ -1679,6 +1727,21 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) { if (H5I_DATASET != it) return FAIL; + /* get dataset space */ + if ((sid = H5Dget_space(did)) < 0) + return FAIL; + + /* get rank */ + if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) + goto out; + + /* close dataset space */ + if (H5Sclose(sid) < 0) + goto out; + + if ( idx >= (unsigned)rank ) + return FAIL; + /*------------------------------------------------------------------------- * attribute "DIMENSION_LABELS" *------------------------------------------------------------------------- @@ -1694,19 +1757,7 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) { if (label) label[0] = 0; return 0; - } - - /* get dataset space */ - if ((sid = H5Dget_space(did)) < 0) - return FAIL; - - /* get rank */ - if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - goto out; - - /* close dataset space */ - if (H5Sclose(sid) < 0) - goto out; + } /*------------------------------------------------------------------------- * open the attribute and read label @@ -1737,7 +1788,8 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) { copy_len = MIN(size-1, nbytes); /* copy all/some of the name */ - if (label) { + if (label) + { memcpy(label, buf[idx], copy_len); /* terminate the string */ @@ -1745,7 +1797,8 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) { } /* free all the ptr's from the H5Aread() */ - for (i = 0; i < (unsigned int) rank; i++) { + for (i = 0; i < rank; i++) + { if (buf[i]) free(buf[i]); } @@ -1765,9 +1818,11 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) { /* error zone */ out: - if (buf) { + if (buf) + { /* free all the ptr's from the H5Aread() */ - for (i = 0; i < (unsigned int) rank; i++) { + for (i = 0; i < rank; i++) + { if (buf[i]) free(buf[i]); } @@ -2186,7 +2241,8 @@ herr_t H5DS_is_reserved(hid_t did) /* error zone */ out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Tclose(tid); H5Aclose(aid); } H5E_END_TRY; diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 479b572..361a65b 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5IMprivate.h" #include "H5LTprivate.h" @@ -19,155 +19,156 @@ #include /*------------------------------------------------------------------------- - * Function: H5IMmake_image_8bit - * - * Purpose: Creates and writes an image an 8 bit image - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: June 13, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMmake_image_8bit +* +* Purpose: Creates and writes an image an 8 bit image +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: June 13, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMmake_image_8bit( hid_t loc_id, - const char *dset_name, - hsize_t width, - hsize_t height, - const unsigned char *buffer ) + const char *dset_name, + hsize_t width, + hsize_t height, + const unsigned char *buf ) { - hsize_t dims[IMAGE8_RANK]; + hsize_t dims[IMAGE8_RANK]; - /* Initialize the image dimensions */ - dims[0] = height; - dims[1] = width; + /* Initialize the image dimensions */ + dims[0] = height; + dims[1] = width; - /* Make the dataset */ - if ( H5LTmake_dataset( loc_id, dset_name, IMAGE8_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0) - return -1; + /* Make the dataset */ + if ( H5LTmake_dataset( loc_id, dset_name, IMAGE8_RANK, dims, H5T_NATIVE_UCHAR, buf ) < 0) + return -1; - /* Attach the CLASS attribute */ - if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0) - return -1; + /* Attach the CLASS attribute */ + if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0) + return -1; - /* Attach the VERSION attribute */ - if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0) - return -1; + /* Attach the VERSION attribute */ + if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0) + return -1; - /* Attach the IMAGE_SUBCLASS attribute */ - if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_INDEXED" ) < 0) - return -1; + /* Attach the IMAGE_SUBCLASS attribute */ + if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_INDEXED" ) < 0) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5IMmake_image_24bit - * - * Purpose: - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: June 13, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Interlace Mode Dimensions in the Dataspace - * INTERLACE_PIXEL [height][width][pixel components] - * INTERLACE_PLANE [pixel components][height][width] - * - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMmake_image_24bit +* +* Purpose: +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: June 13, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Interlace Mode Dimensions in the Dataspace +* INTERLACE_PIXEL [height][width][pixel components] +* INTERLACE_PLANE [pixel components][height][width] +* +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMmake_image_24bit( hid_t loc_id, - const char *dset_name, - hsize_t width, - hsize_t height, - const char *interlace, - const unsigned char *buffer ) + const char *dset_name, + hsize_t width, + hsize_t height, + const char *interlace, + const unsigned char *buf ) { - hsize_t dims[IMAGE24_RANK]; - - /* Initialize the image dimensions */ - - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) - { - /* Number of color planes is defined as the third dimension */ - dims[0] = height; - dims[1] = width; - dims[2] = IMAGE24_RANK; - } - else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) - { - /* Number of color planes is defined as the first dimension */ - dims[0] = IMAGE24_RANK; - dims[1] = height; - dims[2] = width; - } - else return -1; - - /* Make the dataset */ - if ( H5LTmake_dataset( loc_id, dset_name, IMAGE24_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0) - return -1; - - /* Attach the CLASS attribute */ - if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0) - return -1; - - /* Attach the VERSION attribute */ - if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0) - return -1; - - /* Attach the IMAGE_SUBCLASS attribute */ - if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR" ) < 0) - return -1; - - /* Attach the INTERLACE_MODE attribute. This attributes is only for true color images */ - if ( H5LTset_attribute_string( loc_id, dset_name, "INTERLACE_MODE", interlace ) < 0) - return -1; - - return 0; + hsize_t dims[IMAGE24_RANK]; + + /* Initialize the image dimensions */ + + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + { + /* Number of color planes is defined as the third dimension */ + dims[0] = height; + dims[1] = width; + dims[2] = IMAGE24_RANK; + } + else + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + { + /* Number of color planes is defined as the first dimension */ + dims[0] = IMAGE24_RANK; + dims[1] = height; + dims[2] = width; + } + else return -1; + + /* Make the dataset */ + if ( H5LTmake_dataset( loc_id, dset_name, IMAGE24_RANK, dims, H5T_NATIVE_UCHAR, buf ) < 0) + return -1; + + /* Attach the CLASS attribute */ + if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0) + return -1; + + /* Attach the VERSION attribute */ + if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0) + return -1; + + /* Attach the IMAGE_SUBCLASS attribute */ + if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR" ) < 0) + return -1; + + /* Attach the INTERLACE_MODE attribute. This attributes is only for true color images */ + if ( H5LTset_attribute_string( loc_id, dset_name, "INTERLACE_MODE", interlace ) < 0) + return -1; + + return 0; } /*------------------------------------------------------------------------- - * Function: find_palette - * - * Purpose: operator function used by H5LT_find_palette - * - * Return: - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: May 28, 2001 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static herr_t -find_palette(hid_t loc_id, const char *name, const H5A_info_t *ainfo, - void *op_data) +* Function: find_palette +* +* Purpose: operator function used by H5LT_find_palette +* +* Return: +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: May 28, 2001 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ +static herr_t find_palette(hid_t loc_id, + const char *name, + const H5A_info_t *ainfo, + void *op_data) { int ret = H5_ITER_CONT; @@ -175,9 +176,9 @@ find_palette(hid_t loc_id, const char *name, const H5A_info_t *ainfo, loc_id = loc_id; ainfo = ainfo; op_data = op_data; /* Define a positive value for return value if the attribute was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success - */ + * cause the iterator to immediately return that positive value, + * indicating short-circuit success + */ if(strcmp(name, "PALETTE") == 0) ret = H5_ITER_STOP; @@ -186,23 +187,23 @@ find_palette(hid_t loc_id, const char *name, const H5A_info_t *ainfo, /*------------------------------------------------------------------------- - * Function: H5IM_find_palette - * - * Purpose: Private function. Find the attribute "PALETTE" in the image dataset - * - * Return: Success: 1, Failure: 0 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: May 11, 2001 - * - * Comments: - * The function uses H5Aiterate2 with the operator function find_palette - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IM_find_palette +* +* Purpose: Private function. Find the attribute "PALETTE" in the image dataset +* +* Return: Success: 1, Failure: 0 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: May 11, 2001 +* +* Comments: +* The function uses H5Aiterate2 with the operator function find_palette +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IM_find_palette( hid_t loc_id ) { @@ -211,1007 +212,1011 @@ herr_t H5IM_find_palette( hid_t loc_id ) /*------------------------------------------------------------------------- - * Function: H5IMget_image_info - * - * Purpose: Gets information about an image dataset (dimensions, interlace mode - * and number of associated palettes). - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: July 25, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMget_image_info +* +* Purpose: Gets information about an image dataset (dimensions, interlace mode +* and number of associated palettes). +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: July 25, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMget_image_info( hid_t loc_id, - const char *dset_name, - hsize_t *width, - hsize_t *height, - hsize_t *planes, - char *interlace, - hssize_t *npals ) + const char *dset_name, + hsize_t *width, + hsize_t *height, + hsize_t *planes, + char *interlace, + hssize_t *npals ) { - hid_t did, sid; - hsize_t dims[IMAGE24_RANK]; - hid_t attr_id; - hid_t attr_type; - int has_attr; - hid_t attr_space_id; - hid_t attr_class; - int has_pal; + hid_t did; + hid_t sid; + hsize_t dims[IMAGE24_RANK]; + hid_t aid; + hid_t asid; + hid_t atid; + H5T_class_t aclass; + int has_pal; + int has_attr; - /*assume initially we have no palettes attached*/ - *npals = 0; + /*assume initially we have no palettes attached*/ + *npals = 0; - /* Open the dataset. */ - if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the dataset. */ + if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) + return -1; - /* Try to find the attribute "INTERLACE_MODE" on the >>image<< dataset */ - has_attr = H5LT_find_attribute(did, "INTERLACE_MODE"); + /* Try to find the attribute "INTERLACE_MODE" on the >>image<< dataset */ + has_attr = H5LT_find_attribute(did, "INTERLACE_MODE"); - /* It exists, get it */ - if(has_attr == 1) - { + /* It exists, get it */ + if(has_attr == 1) + { - if((attr_id = H5Aopen(did, "INTERLACE_MODE", H5P_DEFAULT)) < 0) - goto out; + if((aid = H5Aopen(did, "INTERLACE_MODE", H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((atid = H5Aget_type(aid)) < 0) + goto out; - if(H5Aread(attr_id, attr_type, interlace) < 0) - goto out; + if(H5Aread(aid, atid, interlace) < 0) + goto out; - if(H5Tclose(attr_type) < 0) - goto out; + if(H5Tclose(atid) < 0) + goto out; - if(H5Aclose(attr_id) < 0) - goto out; - } + if(H5Aclose(aid) < 0) + goto out; + } - /* Get the dataspace handle */ - if ( (sid = H5Dget_space( did )) < 0) - goto out; + /* Get the dataspace handle */ + if ( (sid = H5Dget_space( did )) < 0) + goto out; - /* Get dimensions */ - if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0) - goto out; + /* Get dimensions */ + if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0) + goto out; - /* Initialize the image dimensions */ + /* Initialize the image dimensions */ - if ( has_attr == 1 ) - /* This is a 24 bit image */ - { + if ( has_attr == 1 ) + /* This is a 24 bit image */ + { - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) - { - /* Number of color planes is defined as the third dimension */ - *height = dims[0]; - *width = dims[1]; - *planes = dims[2]; - } - else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) - { - /* Number of color planes is defined as the first dimension */ - *planes = dims[0]; - *height = dims[1]; - *width = dims[2]; - } - else return -1; - } - else - /* This is a 8 bit image */ - { - *height = dims[0]; - *width = dims[1]; - *planes = 1; - } + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + { + /* Number of color planes is defined as the third dimension */ + *height = dims[0]; + *width = dims[1]; + *planes = dims[2]; + } + else + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + { + /* Number of color planes is defined as the first dimension */ + *planes = dims[0]; + *height = dims[1]; + *width = dims[2]; + } + else return -1; + } + else + /* This is a 8 bit image */ + { + *height = dims[0]; + *width = dims[1]; + *planes = 1; + } - /* Close */ - if ( H5Sclose( sid ) < 0) - goto out; + /* Close */ + if ( H5Sclose( sid ) < 0) + goto out; - /* Get number of palettes */ + /* Get number of palettes */ - /* Try to find the attribute "PALETTE" on the >>image<< dataset */ - has_pal = H5IM_find_palette(did); + /* Try to find the attribute "PALETTE" on the >>image<< dataset */ + has_pal = H5IM_find_palette(did); - if(has_pal == 1) - { + if(has_pal == 1) + { - if((attr_id = H5Aopen(did, "PALETTE", H5P_DEFAULT)) < 0) - goto out; + if((aid = H5Aopen(did, "PALETTE", H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((atid = H5Aget_type(aid)) < 0) + goto out; - if((attr_class = H5Tget_class(attr_type)) < 0) - goto out; + if((aclass = H5Tget_class(atid)) < 0) + goto out; - /* Check if it is really a reference */ + /* Check if it is really a reference */ - if(attr_class == H5T_REFERENCE) - { + if(aclass == H5T_REFERENCE) + { - /* Get the reference(s) */ + /* Get the reference(s) */ - if ( (attr_space_id = H5Aget_space( attr_id )) < 0) - goto out; + if ( (asid = H5Aget_space( aid )) < 0) + goto out; - *npals = H5Sget_simple_extent_npoints( attr_space_id ); + *npals = H5Sget_simple_extent_npoints( asid ); - if ( H5Sclose( attr_space_id ) < 0) - goto out; + if ( H5Sclose( asid ) < 0) + goto out; - } /* H5T_REFERENCE */ + } /* H5T_REFERENCE */ - if ( H5Tclose( attr_type ) < 0) - goto out; + if ( H5Tclose( atid ) < 0) + goto out; - /* Close the attribute. */ - if ( H5Aclose( attr_id ) < 0) - goto out; + /* Close the attribute. */ + if ( H5Aclose( aid ) < 0) + goto out; - } + } - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) < 0) - goto out; + /* End access to the dataset and release resources used by it. */ + if ( H5Dclose( did ) < 0) + goto out; - return 0; + return 0; out: - H5Dclose( did ); - return -1; + H5Dclose( did ); + H5Aclose( aid ); + H5Sclose( asid ); + H5Tclose( atid ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5IMread_image - * - * Purpose: Reads image data from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: June 13, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMread_image +* +* Purpose: Reads image data from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: June 13, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMread_image( hid_t loc_id, const char *dset_name, - unsigned char *buffer ) + unsigned char *buf ) { - hid_t did; + hid_t did; - /* Open the dataset. */ - if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the dataset. */ + if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) + return -1; - /* Read */ - if ( H5Dread( did, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer ) < 0) - goto out; + /* Read */ + if ( H5Dread( did, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf ) < 0) + goto out; - /* End access to the dataset and release resources used by it. */ - if ( H5Dclose( did ) ) - return -1; + /* End access to the dataset and release resources used by it. */ + if ( H5Dclose( did ) ) + return -1; - return 0; + return 0; out: - H5Dclose( did ); - return -1; + H5Dclose( did ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5IMmake_palette - * - * Purpose: Creates and writes a palette. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: May 01, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMmake_palette +* +* Purpose: Creates and writes a palette. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: May 01, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMmake_palette( hid_t loc_id, - const char *pal_name, - const hsize_t *pal_dims, - const unsigned char *pal_data ) + const char *pal_name, + const hsize_t *pal_dims, + const unsigned char *pal_data ) { - int has_pal; + int has_pal; - /* Check if the dataset already exists */ - has_pal = H5LTfind_dataset( loc_id, pal_name ); + /* Check if the dataset already exists */ + has_pal = H5LTfind_dataset( loc_id, pal_name ); - /* It exists. Return */ - if ( has_pal == 1 ) - return 0; + /* It exists. Return */ + if ( has_pal == 1 ) + return 0; - /* Make the palette dataset. */ - if ( H5LTmake_dataset( loc_id, pal_name, 2, pal_dims, H5T_NATIVE_UCHAR, pal_data ) < 0 ) - return -1; + /* Make the palette dataset. */ + if ( H5LTmake_dataset( loc_id, pal_name, 2, pal_dims, H5T_NATIVE_UCHAR, pal_data ) < 0 ) + return -1; - /* Attach the attribute "CLASS" to the >>palette<< dataset*/ - if ( H5LTset_attribute_string( loc_id, pal_name, "CLASS", PALETTE_CLASS ) < 0) - return -1; + /* Attach the attribute "CLASS" to the >>palette<< dataset*/ + if ( H5LTset_attribute_string( loc_id, pal_name, "CLASS", PALETTE_CLASS ) < 0) + return -1; - /* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/ - if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0) - return -1; + /* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/ + if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5IMlink_palette - * - * Purpose: This function attaches a palette to an existing image dataset - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: May 01, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * An image (dataset) within an HDF5 file may optionally specify an array of - * palettes to be viewed with. The dataset will have an attribute - * which contains an array of object reference pointers which refer to palettes in the file. - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMlink_palette +* +* Purpose: This function attaches a palette to an existing image dataset +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: May 01, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* An image (dataset) within an HDF5 file may optionally specify an array of +* palettes to be viewed with. The dataset will have an attribute +* which contains an array of object reference pointers which refer to palettes in the file. +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMlink_palette( hid_t loc_id, - const char *image_name, - const char *pal_name ) + const char *image_name, + const char *pal_name ) { - hid_t image_id; - hid_t attr_type=-1; - hid_t attr_id=-1; - hid_t attr_space_id=-1; - hobj_ref_t ref; /* write a new reference */ - hobj_ref_t *refbuf; /* buffer to read references */ - hssize_t n_refs; - hsize_t dim_ref; - int ok_pal; - - /* The image dataset may or may not have the attribute "PALETTE" - * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference - * to the new palette - */ - - /* First we get the image id */ - if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) - return -1; - - /* Try to find the attribute "PALETTE" on the >>image<< dataset */ - ok_pal = H5LT_find_attribute( image_id, "PALETTE" ); + hid_t did; + hid_t atid=-1; + hid_t aid=-1; + hid_t asid=-1; + hobj_ref_t ref; /* write a new reference */ + hobj_ref_t *refbuf; /* buffer to read references */ + hssize_t n_refs; + hsize_t dim_ref; + int ok_pal; + + /* The image dataset may or may not have the attribute "PALETTE" + * First we try to open to see if it is already there; if not, it is created. + * If it exists, the array of references is extended to hold the reference + * to the new palette + */ + + /* First we get the image id */ + if((did = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) + return -1; + + /* Try to find the attribute "PALETTE" on the >>image<< dataset */ + ok_pal = H5LT_find_attribute( did, "PALETTE" ); + + /*------------------------------------------------------------------------- + * It does not exist. We create the attribute and one reference + *------------------------------------------------------------------------- + */ + if(ok_pal == 0 ) + { + if((asid = H5Screate(H5S_SCALAR)) < 0) + goto out; -/*------------------------------------------------------------------------- - * It does not exist. We create the attribute and one reference - *------------------------------------------------------------------------- - */ - if(ok_pal == 0 ) - { - if((attr_space_id = H5Screate(H5S_SCALAR)) < 0) - goto out; - - /* Create the attribute type for the reference */ - if((attr_type = H5Tcopy(H5T_STD_REF_OBJ)) < 0) - goto out; - - /* Create the attribute "PALETTE" to be attached to the image*/ - if((attr_id = H5Acreate2(image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto out; - - /* Create a reference. The reference is created on the local id. */ - if(H5Rcreate(&ref, loc_id, pal_name, H5R_OBJECT, -1) < 0) - goto out; - - /* Write the attribute with the reference */ - if(H5Awrite(attr_id, attr_type, &ref) < 0) - goto out; - - /* close */ - if(H5Sclose(attr_space_id) < 0) - goto out; - if ( H5Tclose( attr_type ) < 0) - goto out; - if(H5Aclose(attr_id) < 0) - goto out; - - } + /* Create the attribute type for the reference */ + if((atid = H5Tcopy(H5T_STD_REF_OBJ)) < 0) + goto out; -/*------------------------------------------------------------------------- - * The attribute already exists, open it - *------------------------------------------------------------------------- - */ - else if(ok_pal == 1) - { - if((attr_id = H5Aopen(image_id, "PALETTE", H5P_DEFAULT)) < 0) - goto out; + /* Create the attribute "PALETTE" to be attached to the image*/ + if((aid = H5Acreate2(did, "PALETTE", atid, asid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + /* Create a reference. The reference is created on the local id. */ + if(H5Rcreate(&ref, loc_id, pal_name, H5R_OBJECT, -1) < 0) + goto out; - if(H5Tget_class(attr_type) < 0) - goto out; + /* Write the attribute with the reference */ + if(H5Awrite(aid, atid, &ref) < 0) + goto out; - /* Get and save the old reference(s) */ - if((attr_space_id = H5Aget_space(attr_id)) < 0) - goto out; + /* close */ + if(H5Sclose(asid) < 0) + goto out; + if ( H5Tclose( atid ) < 0) + goto out; + if(H5Aclose(aid) < 0) + goto out; - n_refs = H5Sget_simple_extent_npoints(attr_space_id); + } - dim_ref = n_refs + 1; + /*------------------------------------------------------------------------- + * The attribute already exists, open it + *------------------------------------------------------------------------- + */ + else if(ok_pal == 1) + { + if((aid = H5Aopen(did, "PALETTE", H5P_DEFAULT)) < 0) + goto out; - refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref ); + if((atid = H5Aget_type(aid)) < 0) + goto out; - if ( H5Aread( attr_id, attr_type, refbuf ) < 0) - goto out; + if(H5Tget_class(atid) < 0) + goto out; - /* The attribute must be deleted, in order to the new one can reflect the changes*/ - if(H5Adelete(image_id, "PALETTE") < 0) - goto out; + /* Get and save the old reference(s) */ + if((asid = H5Aget_space(aid)) < 0) + goto out; - /* Create a new reference for this palette. */ - if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0) - goto out; + n_refs = H5Sget_simple_extent_npoints(asid); - refbuf[n_refs] = ref; + dim_ref = n_refs + 1; - /* Create the data space for the new references */ - if(H5Sclose(attr_space_id) < 0) - goto out; + refbuf = (hobj_ref_t*)malloc( sizeof(hobj_ref_t) * (int)dim_ref ); - if((attr_space_id = H5Screate_simple(1, &dim_ref, NULL)) < 0) - goto out; + if ( H5Aread( aid, atid, refbuf ) < 0) + goto out; - /* Create the attribute again with the changes of space */ - if(H5Aclose(attr_id) < 0) - goto out; + /* The attribute must be deleted, in order to the new one can reflect the changes*/ + if(H5Adelete(did, "PALETTE") < 0) + goto out; - if((attr_id = H5Acreate2(image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto out; + /* Create a new reference for this palette. */ + if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0) + goto out; - /* Write the attribute with the new references */ - if(H5Awrite(attr_id, attr_type, refbuf) < 0) - goto out; + refbuf[n_refs] = ref; - /* close */ - if(H5Sclose(attr_space_id) < 0) - goto out; - if(H5Aclose(attr_id) < 0) - goto out; + /* Create the data space for the new references */ + if(H5Sclose(asid) < 0) + goto out; - free( refbuf ); + if((asid = H5Screate_simple(1, &dim_ref, NULL)) < 0) + goto out; - } /* ok_pal == 1 */ + /* Create the attribute again with the changes of space */ + if(H5Aclose(aid) < 0) + goto out; - /* Close the image dataset. */ - if ( H5Dclose( image_id ) < 0) - return -1; + if((aid = H5Acreate2(did, "PALETTE", atid, asid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; - return 0; + /* Write the attribute with the new references */ + if(H5Awrite(aid, atid, refbuf) < 0) + goto out; + + /* close */ + if(H5Sclose(asid) < 0) + goto out; + if(H5Aclose(aid) < 0) + goto out; + + free( refbuf ); + + } /* ok_pal == 1 */ + + /* Close the image dataset. */ + if ( H5Dclose( did ) < 0) + return -1; + + return 0; out: - H5Dclose( image_id ); - H5Sclose( attr_space_id ); - H5Tclose( attr_type ); - H5Aclose( attr_id ); - return -1; + H5Dclose( did ); + H5Sclose( asid ); + H5Tclose( atid ); + H5Aclose( aid ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5IMunlink_palette - * - * Purpose: This function dettaches a palette from an existing image dataset - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: September 10, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMunlink_palette +* +* Purpose: This function dettaches a palette from an existing image dataset +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: September 10, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMunlink_palette( hid_t loc_id, - const char *image_name, - const char *pal_name ) + const char *image_name, + const char *pal_name ) { - hid_t image_id; - hid_t attr_type; - hid_t attr_id; - hid_t attr_class; - int ok_pal, has_pal; + hid_t did; + hid_t atid; + hid_t aid; + H5T_class_t aclass; + int ok_pal, has_pal; - /* Try to find the palette dataset */ - has_pal = H5LTfind_dataset( loc_id, pal_name ); + /* Try to find the palette dataset */ + has_pal = H5LTfind_dataset( loc_id, pal_name ); - /* It does not exist. Return */ - if ( has_pal == 0 ) - return -1; + /* It does not exist. Return */ + if ( has_pal == 0 ) + return -1; - /* The image dataset may or not have the attribute "PALETTE" - * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference - * to the new palette - */ + /* The image dataset may or not have the attribute "PALETTE" + * First we try to open to see if it is already there; if not, it is created. + * If it exists, the array of references is extended to hold the reference + * to the new palette + */ - /* First we get the image id */ - if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) - return -1; + /* First we get the image id */ + if((did = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) + return -1; - /* Try to find the attribute "PALETTE" on the >>image<< dataset */ - ok_pal = H5LT_find_attribute(image_id, "PALETTE"); + /* Try to find the attribute "PALETTE" on the >>image<< dataset */ + ok_pal = H5LT_find_attribute(did, "PALETTE"); - /* It does not exist. Nothing to do */ - if(ok_pal == 0) - return -1; + /* It does not exist. Nothing to do */ + if(ok_pal == 0) + return -1; - /* The attribute exists, open it */ - else if(ok_pal == 1) - { - if((attr_id = H5Aopen(image_id, "PALETTE", H5P_DEFAULT)) < 0) - goto out; + /* The attribute exists, open it */ + else if(ok_pal == 1) + { + if((aid = H5Aopen(did, "PALETTE", H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((atid = H5Aget_type(aid)) < 0) + goto out; - if((attr_class = H5Tget_class(attr_type)) < 0) - goto out; + if((aclass = H5Tget_class(atid)) < 0) + goto out; - /* Check if it is really a reference */ - if(attr_class == H5T_REFERENCE) - { - /* Delete the attribute */ - if(H5Adelete(image_id, "PALETTE") < 0) - goto out; + /* Check if it is really a reference */ + if(aclass == H5T_REFERENCE) + { + /* Delete the attribute */ + if(H5Adelete(did, "PALETTE") < 0) + goto out; - } /* H5T_REFERENCE */ + } /* H5T_REFERENCE */ - if(H5Tclose(attr_type) < 0) - goto out; + if(H5Tclose(atid) < 0) + goto out; - /* Close the attribute. */ - if(H5Aclose(attr_id) < 0) - goto out; + /* Close the attribute. */ + if(H5Aclose(aid) < 0) + goto out; - } /* ok_pal */ + } /* ok_pal */ - /* Close the image dataset. */ - if(H5Dclose(image_id) < 0) - return -1; + /* Close the image dataset. */ + if(H5Dclose(did) < 0) + return -1; - return 0; + return 0; out: - H5Dclose( image_id ); - return -1; + H5Dclose( did ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5IMget_npalettes - * - * Purpose: Gets the number of palettes associated to an image - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: July 22, 2001 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMget_npalettes +* +* Purpose: Gets the number of palettes associated to an image +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: July 22, 2001 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMget_npalettes( hid_t loc_id, - const char *image_name, - hssize_t *npals ) + const char *image_name, + hssize_t *npals ) { - hid_t image_id; - hid_t attr_type; - hid_t attr_id; - hid_t attr_space_id; - hid_t attr_class; - int has_pal; + hid_t did; + hid_t atid; + hid_t aid; + hid_t asid; + H5T_class_t aclass; + int has_pal; - /*assume initially we have no palettes attached*/ - *npals = 0; + /*assume initially we have no palettes attached*/ + *npals = 0; - /* Open the dataset. */ - if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the dataset. */ + if((did = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) + return -1; - /* Try to find the attribute "PALETTE" on the >>image<< dataset */ - has_pal = H5IM_find_palette(image_id); + /* Try to find the attribute "PALETTE" on the >>image<< dataset */ + has_pal = H5IM_find_palette(did); - if(has_pal == 1 ) - { + if(has_pal == 1 ) + { - if((attr_id = H5Aopen(image_id, "PALETTE", H5P_DEFAULT)) < 0) - goto out; + if((aid = H5Aopen(did, "PALETTE", H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((atid = H5Aget_type(aid)) < 0) + goto out; - if((attr_class = H5Tget_class(attr_type)) < 0) - goto out; + if((aclass = H5Tget_class(atid)) < 0) + goto out; - /* Check if it is really a reference */ + /* Check if it is really a reference */ - if(attr_class == H5T_REFERENCE) - { - if((attr_space_id = H5Aget_space(attr_id)) < 0) - goto out; + if(aclass == H5T_REFERENCE) + { + if((asid = H5Aget_space(aid)) < 0) + goto out; - *npals = H5Sget_simple_extent_npoints( attr_space_id ); + *npals = H5Sget_simple_extent_npoints( asid ); - if ( H5Sclose( attr_space_id ) < 0) - goto out; + if ( H5Sclose( asid ) < 0) + goto out; - } /* H5T_REFERENCE */ + } /* H5T_REFERENCE */ - if ( H5Tclose( attr_type ) < 0) - goto out; + if ( H5Tclose( atid ) < 0) + goto out; - /* Close the attribute. */ - if ( H5Aclose( attr_id ) < 0) - goto out; + /* Close the attribute. */ + if ( H5Aclose( aid ) < 0) + goto out; - } + } - /* Close the image dataset. */ - if ( H5Dclose( image_id ) < 0) - return -1; + /* Close the image dataset. */ + if ( H5Dclose( did ) < 0) + return -1; - return 0; + return 0; out: - H5Dclose( image_id ); - return -1; + H5Dclose( did ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5IMget_palette_info - * - * Purpose: Get palette information - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: July 22, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMget_palette_info +* +* Purpose: Get palette information +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: July 22, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMget_palette_info( hid_t loc_id, - const char *image_name, - int pal_number, - hsize_t *pal_dims ) + const char *image_name, + int pal_number, + hsize_t *pal_dims ) { - hid_t image_id; - int has_pal; - hid_t attr_type=-1; - hid_t attr_id; - hid_t attr_space_id=-1; - hssize_t n_refs; - hsize_t dim_ref; - hobj_ref_t *refbuf; /* buffer to read references */ - hid_t pal_id; - hid_t pal_space_id; - hsize_t pal_maxdims[2]; + hid_t did; + int has_pal; + hid_t atid=-1; + hid_t aid; + hid_t asid=-1; + hssize_t n_refs; + hsize_t dim_ref; + hobj_ref_t *refbuf; /* buffer to read references */ + hid_t pal_id; + hid_t pal_space_id; + hsize_t pal_maxdims[2]; - /* Open the dataset. */ - if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the dataset. */ + if((did = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) + return -1; - /* Try to find the attribute "PALETTE" on the >>image<< dataset */ - has_pal = H5IM_find_palette(image_id); + /* Try to find the attribute "PALETTE" on the >>image<< dataset */ + has_pal = H5IM_find_palette(did); - if(has_pal == 1) - { - if((attr_id = H5Aopen(image_id, "PALETTE", H5P_DEFAULT)) < 0) - goto out; + if(has_pal == 1) + { + if((aid = H5Aopen(did, "PALETTE", H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((atid = H5Aget_type(aid)) < 0) + goto out; - if(H5Tget_class(attr_type) < 0) - goto out; + if(H5Tget_class(atid) < 0) + goto out; - /* Get the reference(s) */ - if((attr_space_id = H5Aget_space(attr_id)) < 0) - goto out; + /* Get the reference(s) */ + if((asid = H5Aget_space(aid)) < 0) + goto out; - n_refs = H5Sget_simple_extent_npoints(attr_space_id); + n_refs = H5Sget_simple_extent_npoints(asid); - dim_ref = n_refs; + dim_ref = n_refs; - refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref ); + refbuf = (hobj_ref_t*)malloc( sizeof(hobj_ref_t) * (int)dim_ref ); - if ( H5Aread( attr_id, attr_type, refbuf ) < 0) - goto out; + if ( H5Aread( aid, atid, refbuf ) < 0) + goto out; - /* Get the actual palette */ - if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0) - goto out; + /* Get the actual palette */ + if ( (pal_id = H5Rdereference( did, H5R_OBJECT, &refbuf[pal_number] )) < 0) + goto out; - if ( (pal_space_id = H5Dget_space( pal_id )) < 0) - goto out; + if ( (pal_space_id = H5Dget_space( pal_id )) < 0) + goto out; - if ( H5Sget_simple_extent_ndims( pal_space_id ) < 0) - goto out; + if ( H5Sget_simple_extent_ndims( pal_space_id ) < 0) + goto out; - if ( H5Sget_simple_extent_dims( pal_space_id, pal_dims, pal_maxdims ) < 0) - goto out; + if ( H5Sget_simple_extent_dims( pal_space_id, pal_dims, pal_maxdims ) < 0) + goto out; - /* close */ - if (H5Dclose(pal_id)<0) - goto out; - if ( H5Sclose( pal_space_id ) < 0) - goto out; - if ( H5Sclose( attr_space_id ) < 0) - goto out; - if ( H5Tclose( attr_type ) < 0) - goto out; - if ( H5Aclose( attr_id ) < 0) - goto out; - free( refbuf ); + /* close */ + if (H5Dclose(pal_id)<0) + goto out; + if ( H5Sclose( pal_space_id ) < 0) + goto out; + if ( H5Sclose( asid ) < 0) + goto out; + if ( H5Tclose( atid ) < 0) + goto out; + if ( H5Aclose( aid ) < 0) + goto out; + free( refbuf ); - } + } - /* Close the image dataset. */ - if ( H5Dclose( image_id ) < 0) - return -1; + /* Close the image dataset. */ + if ( H5Dclose( did ) < 0) + return -1; - return 0; + return 0; out: - H5Dclose( image_id ); - H5Sclose( attr_space_id ); - H5Tclose( attr_type ); - H5Aclose( attr_id ); - return -1; + H5Dclose( did ); + H5Sclose( asid ); + H5Tclose( atid ); + H5Aclose( aid ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5IMget_palette - * - * Purpose: Read palette - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: August 30, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMget_palette +* +* Purpose: Read palette +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: August 30, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMget_palette( hid_t loc_id, - const char *image_name, - int pal_number, - unsigned char *pal_data ) + const char *image_name, + int pal_number, + unsigned char *pal_data ) { - hid_t image_id; - int has_pal; - hid_t attr_type=-1; - hid_t attr_id; - hid_t attr_space_id=-1; - hssize_t n_refs; - hsize_t dim_ref; - hobj_ref_t *refbuf; /* buffer to read references */ - hid_t pal_id; + hid_t did; + int has_pal; + hid_t atid=-1; + hid_t aid; + hid_t asid=-1; + hssize_t n_refs; + hsize_t dim_ref; + hobj_ref_t *refbuf; /* buffer to read references */ + hid_t pal_id; - /* Open the dataset. */ - if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the dataset. */ + if((did = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0) + return -1; - /* Try to find the attribute "PALETTE" on the >>image<< dataset */ - has_pal = H5IM_find_palette(image_id); + /* Try to find the attribute "PALETTE" on the >>image<< dataset */ + has_pal = H5IM_find_palette(did); - if(has_pal == 1 ) - { - if((attr_id = H5Aopen(image_id, "PALETTE", H5P_DEFAULT)) < 0) - goto out; + if(has_pal == 1 ) + { + if((aid = H5Aopen(did, "PALETTE", H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((atid = H5Aget_type(aid)) < 0) + goto out; - if(H5Tget_class(attr_type) < 0) - goto out; + if(H5Tget_class(atid) < 0) + goto out; - /* Get the reference(s) */ - if((attr_space_id = H5Aget_space(attr_id)) < 0) - goto out; + /* Get the reference(s) */ + if((asid = H5Aget_space(aid)) < 0) + goto out; - n_refs = H5Sget_simple_extent_npoints(attr_space_id); + n_refs = H5Sget_simple_extent_npoints(asid); - dim_ref = n_refs; + dim_ref = n_refs; - refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref ); + refbuf = (hobj_ref_t*)malloc( sizeof(hobj_ref_t) * (int)dim_ref ); - if ( H5Aread( attr_id, attr_type, refbuf ) < 0) - goto out; + if ( H5Aread( aid, atid, refbuf ) < 0) + goto out; - /* Get the palette id */ - if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0) - goto out; + /* Get the palette id */ + if ( (pal_id = H5Rdereference( did, H5R_OBJECT, &refbuf[pal_number] )) < 0) + goto out; - /* Read the palette dataset */ - if ( H5Dread( pal_id, H5Dget_type(pal_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data ) < 0) - goto out; + /* Read the palette dataset */ + if ( H5Dread( pal_id, H5Dget_type(pal_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data ) < 0) + goto out; - /* close */ - if (H5Dclose(pal_id)<0) - goto out; - if ( H5Sclose( attr_space_id ) < 0) - goto out; - if ( H5Tclose( attr_type ) < 0) - goto out; - if ( H5Aclose( attr_id ) < 0) - goto out; - free( refbuf ); - } + /* close */ + if (H5Dclose(pal_id)<0) + goto out; + if ( H5Sclose( asid ) < 0) + goto out; + if ( H5Tclose( atid ) < 0) + goto out; + if ( H5Aclose( aid ) < 0) + goto out; + free( refbuf ); + } - /* Close the image dataset. */ - if ( H5Dclose( image_id ) < 0) - return -1; + /* Close the image dataset. */ + if ( H5Dclose( did ) < 0) + return -1; - return 0; + return 0; out: - H5Dclose( image_id ); - H5Sclose( attr_space_id ); - H5Tclose( attr_type ); - H5Aclose( attr_id ); - return -1; + H5Dclose( did ); + H5Sclose( asid ); + H5Tclose( atid ); + H5Aclose( aid ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5IMis_image - * - * Purpose: - * - * Return: true, false, fail - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: August 30, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMis_image +* +* Purpose: +* +* Return: true, false, fail +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: August 30, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMis_image( hid_t loc_id, - const char *dset_name ) + const char *dset_name ) { - hid_t did; - int has_class; - hid_t attr_type; - hid_t attr_id; - char attr_data[20]; - herr_t ret; + hid_t did; + int has_class; + hid_t atid; + hid_t aid; + char attr_data[20]; + herr_t ret; - /* Assume initially fail condition */ - ret = -1; + /* Assume initially fail condition */ + ret = -1; - /* Open the dataset. */ - if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the dataset. */ + if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) + return -1; - /* Try to find the attribute "CLASS" on the dataset */ - has_class = H5LT_find_attribute(did, "CLASS"); + /* Try to find the attribute "CLASS" on the dataset */ + has_class = H5LT_find_attribute(did, "CLASS"); - if(has_class == 0) - { - H5Dclose(did); - return 0; - } - else if(has_class == 1) - { + if(has_class == 0) + { + H5Dclose(did); + return 0; + } + else if(has_class == 1) + { - if((attr_id = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0) - goto out; + if((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((atid = H5Aget_type(aid)) < 0) + goto out; - if(H5Tget_class(attr_type) < 0) - goto out; + if(H5Tget_class(atid) < 0) + goto out; - if(H5Aread(attr_id, attr_type, attr_data) < 0) - goto out; + if(H5Aread(aid, atid, attr_data) < 0) + goto out; - if(strcmp(attr_data, IMAGE_CLASS) == 0) - ret = 1; - else - ret = 0; + if(strcmp(attr_data, IMAGE_CLASS) == 0) + ret = 1; + else + ret = 0; - if ( H5Tclose( attr_type ) < 0) - goto out; + if ( H5Tclose( atid ) < 0) + goto out; - if ( H5Aclose( attr_id ) < 0) - goto out; + if ( H5Aclose( aid ) < 0) + goto out; - } + } - /* Close the dataset. */ - if ( H5Dclose( did ) < 0) - return -1; + /* Close the dataset. */ + if ( H5Dclose( did ) < 0) + return -1; - return ret; + return ret; out: - H5Dclose( did ); - return -1; + H5Dclose( did ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5IMis_palette - * - * Purpose: - * - * Return: true, false, fail - * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu - * - * Date: August 30, 2001 - * - * Comments: - * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5IMis_palette +* +* Purpose: +* +* Return: true, false, fail +* +* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* +* Date: August 30, 2001 +* +* Comments: +* based on HDF5 Image and Palette Specification +* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5IMis_palette( hid_t loc_id, - const char *dset_name ) + const char *dset_name ) { - hid_t did; - int has_class; - hid_t attr_type; - hid_t attr_id; - char attr_data[20]; - herr_t ret; + hid_t did; + int has_class; + hid_t atid; + hid_t aid; + char attr_data[20]; + herr_t ret; - /* Assume initially fail condition */ - ret = -1; + /* Assume initially fail condition */ + ret = -1; - /* Open the dataset. */ - if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the dataset. */ + if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) + return -1; - /* Try to find the attribute "CLASS" on the dataset */ - has_class = H5LT_find_attribute(did, "CLASS"); + /* Try to find the attribute "CLASS" on the dataset */ + has_class = H5LT_find_attribute(did, "CLASS"); - if(has_class == 0) - { - H5Dclose( did ); - return 0; - } - else if(has_class == 1) - { + if(has_class == 0) + { + H5Dclose( did ); + return 0; + } + else if(has_class == 1) + { - if((attr_id = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0) - goto out; + if((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0) + goto out; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((atid = H5Aget_type(aid)) < 0) + goto out; - if(H5Tget_class(attr_type) < 0) - goto out; + if(H5Tget_class(atid) < 0) + goto out; - if(H5Aread(attr_id, attr_type, attr_data) < 0) - goto out; + if(H5Aread(aid, atid, attr_data) < 0) + goto out; - if(strcmp(attr_data, PALETTE_CLASS) == 0) - ret = 1; - else - ret = 0; + if(strcmp(attr_data, PALETTE_CLASS) == 0) + ret = 1; + else + ret = 0; - if ( H5Tclose( attr_type ) < 0) - goto out; + if ( H5Tclose( atid ) < 0) + goto out; - if ( H5Aclose( attr_id ) < 0) - goto out; + if ( H5Aclose( aid ) < 0) + goto out; - } + } - /* Close the dataset. */ - if ( H5Dclose( did ) < 0) - return -1; + /* Close the dataset. */ + if ( H5Dclose( did ) < 0) + return -1; - return ret; + return ret; out: - H5Dclose( did ); - return -1; + H5Dclose( did ); + return -1; } diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 92965fd..7c073d6 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -33,38 +33,38 @@ int indent = 0; /*------------------------------------------------------------------------- - * - * internal functions - * - *------------------------------------------------------------------------- - */ +* +* internal functions +* +*------------------------------------------------------------------------- +*/ static herr_t H5LT_get_attribute_mem(hid_t loc_id, - const char *obj_name, - const char *attr_name, - hid_t mem_type_id, - void *data); - -/*------------------------------------------------------------------------- - * Function: H5LT_make_dataset - * - * Purpose: Creates and writes a dataset of a type tid - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: October 10, 2007 - * - *------------------------------------------------------------------------- - */ + const char *obj_name, + const char *attr_name, + hid_t mem_type_id, + void *data); + +/*------------------------------------------------------------------------- +* Function: H5LT_make_dataset +* +* Purpose: Creates and writes a dataset of a type tid +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Quincey Koziol, koziol@hdfgroup.org +* +* Date: October 10, 2007 +* +*------------------------------------------------------------------------- +*/ static herr_t H5LT_make_dataset_numerical( hid_t loc_id, - const char *dset_name, - int rank, - const hsize_t *dims, - hid_t tid, - const void *data ) + const char *dset_name, + int rank, + const hsize_t *dims, + hid_t tid, + const void *data ) { hid_t did = -1, sid = -1; @@ -100,124 +100,124 @@ out: } /*------------------------------------------------------------------------- - * - * Public functions - * - *------------------------------------------------------------------------- - */ - -/*------------------------------------------------------------------------- - * Function: H5LTmake_dataset - * - * Purpose: Creates and writes a dataset of a type tid - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 19, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* +* Public functions +* +*------------------------------------------------------------------------- +*/ + +/*------------------------------------------------------------------------- +* Function: H5LTmake_dataset +* +* Purpose: Creates and writes a dataset of a type tid +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 19, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5LTmake_dataset( hid_t loc_id, - const char *dset_name, - int rank, - const hsize_t *dims, - hid_t tid, - const void *data ) + const char *dset_name, + int rank, + const hsize_t *dims, + hid_t tid, + const void *data ) { return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, tid, data)); } /*------------------------------------------------------------------------- - * Function: H5LTmake_dataset_char - * - * Purpose: Creates and writes a dataset of H5T_NATIVE_CHAR type - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 14, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5LTmake_dataset_char +* +* Purpose: Creates and writes a dataset of H5T_NATIVE_CHAR type +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 14, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5LTmake_dataset_char( hid_t loc_id, - const char *dset_name, - int rank, - const hsize_t *dims, - const char *data ) + const char *dset_name, + int rank, + const hsize_t *dims, + const char *data ) { return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_CHAR, data)); } /*------------------------------------------------------------------------- - * Function: H5LTmake_dataset_short - * - * Purpose: Creates and writes a dataset of H5T_NATIVE_SHORT type - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 14, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5LTmake_dataset_short +* +* Purpose: Creates and writes a dataset of H5T_NATIVE_SHORT type +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 14, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5LTmake_dataset_short( hid_t loc_id, - const char *dset_name, - int rank, - const hsize_t *dims, - const short *data ) + const char *dset_name, + int rank, + const hsize_t *dims, + const short *data ) { return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_SHORT, data)); } /*------------------------------------------------------------------------- - * Function: H5LTmake_dataset_int - * - * Purpose: Creates and writes a dataset of H5T_NATIVE_INT type - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 14, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5LTmake_dataset_int +* +* Purpose: Creates and writes a dataset of H5T_NATIVE_INT type +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 14, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5LTmake_dataset_int( hid_t loc_id, - const char *dset_name, - int rank, - const hsize_t *dims, - const int *data ) + const char *dset_name, + int rank, + const hsize_t *dims, + const int *data ) { return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_INT, data)); } @@ -225,59 +225,59 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTmake_dataset_long - * - * Purpose: Creates and writes a dataset of H5T_NATIVE_LONG type - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 14, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5LTmake_dataset_long +* +* Purpose: Creates and writes a dataset of H5T_NATIVE_LONG type +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 14, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5LTmake_dataset_long( hid_t loc_id, - const char *dset_name, - int rank, - const hsize_t *dims, - const long *data ) + const char *dset_name, + int rank, + const hsize_t *dims, + const long *data ) { return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_LONG, data)); } /*------------------------------------------------------------------------- - * Function: H5LTmake_dataset_float - * - * Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 14, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5LTmake_dataset_float +* +* Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 14, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5LTmake_dataset_float( hid_t loc_id, - const char *dset_name, - int rank, - const hsize_t *dims, - const float *data ) + const char *dset_name, + int rank, + const hsize_t *dims, + const float *data ) { return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_FLOAT, data)); } @@ -285,53 +285,53 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTmake_dataset_double - * - * Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 14, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5LTmake_dataset_double +* +* Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 14, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5LTmake_dataset_double( hid_t loc_id, - const char *dset_name, - int rank, - const hsize_t *dims, - const double *data ) + const char *dset_name, + int rank, + const hsize_t *dims, + const double *data ) { return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_DOUBLE, data)); } /*------------------------------------------------------------------------- - * Function: H5LTmake_dataset_string - * - * Purpose: Creates and writes a dataset of H5T_C_S1 type - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 05, 2004 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5LTmake_dataset_string +* +* Purpose: Creates and writes a dataset of H5T_C_S1 type +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: October 05, 2004 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5LTmake_dataset_string(hid_t loc_id, @@ -389,18 +389,18 @@ out: /*------------------------------------------------------------------------- - * Function: H5LT_read_dataset - * - * Purpose: Reads a dataset from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: October 8, 2007 - * - *------------------------------------------------------------------------- - */ +* Function: H5LT_read_dataset +* +* Purpose: Reads a dataset from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Quincey Koziol, koziol@hdfgroup.org +* +* Date: October 8, 2007 +* +*------------------------------------------------------------------------- +*/ static herr_t H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void *data) @@ -427,18 +427,18 @@ out: } /*------------------------------------------------------------------------- - * Function: H5LTread_dataset - * - * Purpose: Reads a dataset from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: June 13, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTread_dataset +* +* Purpose: Reads a dataset from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: June 13, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTread_dataset(hid_t loc_id, const char *dset_name, @@ -450,150 +450,150 @@ herr_t H5LTread_dataset(hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTread_dataset_char - * - * Purpose: Reads a dataset from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 5, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTread_dataset_char +* +* Purpose: Reads a dataset from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 5, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTread_dataset_char( hid_t loc_id, - const char *dset_name, - char *data ) + const char *dset_name, + char *data ) { return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_CHAR, data)); } /*------------------------------------------------------------------------- - * Function: H5LTread_dataset_short - * - * Purpose: Reads a dataset from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 5, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTread_dataset_short +* +* Purpose: Reads a dataset from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 5, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTread_dataset_short( hid_t loc_id, - const char *dset_name, - short *data ) + const char *dset_name, + short *data ) { return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_SHORT, data)); } /*------------------------------------------------------------------------- - * Function: H5LTread_dataset_int - * - * Purpose: Reads a dataset from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 5, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTread_dataset_int +* +* Purpose: Reads a dataset from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 5, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTread_dataset_int( hid_t loc_id, - const char *dset_name, - int *data ) + const char *dset_name, + int *data ) { return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_INT, data)); } /*------------------------------------------------------------------------- - * Function: H5LTread_dataset_long - * - * Purpose: Reads a dataset from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 5, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTread_dataset_long +* +* Purpose: Reads a dataset from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 5, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTread_dataset_long( hid_t loc_id, - const char *dset_name, - long *data ) + const char *dset_name, + long *data ) { return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_LONG, data)); } /*------------------------------------------------------------------------- - * Function: H5LTread_dataset_float - * - * Purpose: Reads a dataset from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 5, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTread_dataset_float +* +* Purpose: Reads a dataset from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 5, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTread_dataset_float( hid_t loc_id, - const char *dset_name, - float *data ) + const char *dset_name, + float *data ) { return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_FLOAT, data)); } /*------------------------------------------------------------------------- - * Function: H5LTread_dataset_double - * - * Purpose: Reads a dataset from disk. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 5, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTread_dataset_double +* +* Purpose: Reads a dataset from disk. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 5, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTread_dataset_double( hid_t loc_id, - const char *dset_name, - double *data ) + const char *dset_name, + double *data ) { return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_DOUBLE, data)); } /*------------------------------------------------------------------------- - * Function: H5LTread_dataset_string - * - * Purpose: Reads a dataset - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 05, 2004 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTread_dataset_string +* +* Purpose: Reads a dataset +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: October 05, 2004 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTread_dataset_string( hid_t loc_id, - const char *dset_name, - char *buf ) + const char *dset_name, + char *buf ) { hid_t did = -1; hid_t tid = -1; @@ -627,22 +627,22 @@ out: /*------------------------------------------------------------------------- - * Function: H5LTget_dataset_ndims - * - * Purpose: Gets the dimensionality of a dataset. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 4, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_dataset_ndims +* +* Purpose: Gets the dimensionality of a dataset. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 4, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_dataset_ndims( hid_t loc_id, - const char *dset_name, - int *rank ) + const char *dset_name, + int *rank ) { hid_t did = -1; hid_t sid = -1; @@ -679,25 +679,25 @@ out: /*------------------------------------------------------------------------- - * Function: H5LTget_dataset_info - * - * Purpose: Gets information about a dataset. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 4, 2001 - * Modified: February 28, 2006: checked for NULL parameters - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_dataset_info +* +* Purpose: Gets information about a dataset. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 4, 2001 +* Modified: February 28, 2006: checked for NULL parameters +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_dataset_info( hid_t loc_id, - const char *dset_name, - hsize_t *dims, - H5T_class_t *type_class, - size_t *type_size ) + const char *dset_name, + hsize_t *dims, + H5T_class_t *type_class, + size_t *type_size ) { hid_t did = -1; hid_t tid = -1; @@ -753,27 +753,27 @@ out: } /*------------------------------------------------------------------------- - * Function: find_dataset - * - * Purpose: operator function used by H5LTfind_dataset - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: June 21, 2001 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: find_dataset +* +* Purpose: operator function used by H5LTfind_dataset +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: June 21, 2001 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ static herr_t find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_data) { /* Define a default zero value for return. This will cause the iterator to continue if - * the dataset is not found yet. - */ + * the dataset is not found yet. + */ int ret = 0; /* Shut the compiler up */ @@ -781,9 +781,9 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d linfo = linfo; /* Define a positive value for return value if the dataset was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success - */ + * cause the iterator to immediately return that positive value, + * indicating short-circuit success + */ if(strcmp(name, (char *)op_data) == 0) ret = 1; @@ -792,26 +792,26 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d /*------------------------------------------------------------------------- - * Function: H5LTfind_dataset - * - * Purpose: Inquires if a dataset named dset_name exists attached - * to the object loc_id. - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: July 15, 2001 - * - * Return: - * Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. - * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - *------------------------------------------------------------------------- - */ +* Function: H5LTfind_dataset +* +* Purpose: Inquires if a dataset named dset_name exists attached +* to the object loc_id. +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: July 15, 2001 +* +* Return: +* Success: The return value of the first operator that +* returns non-zero, or zero if all members were +* processed with no operator returning non-zero. +* +* Failure: Negative if something goes wrong within the +* library, or the negative value returned by one +* of the operators. +* +*------------------------------------------------------------------------- +*/ herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) @@ -821,98 +821,98 @@ H5LTfind_dataset( hid_t loc_id, const char *dset_name ) /*------------------------------------------------------------------------- - * - * Set attribute functions - * - *------------------------------------------------------------------------- - */ +* +* Set attribute functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_string - * - * Purpose: Creates and writes a string attribute named attr_name and attaches - * it to the object specified by the name obj_name. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: July 23, 2001 - * - * Comments: If the attribute already exists, it is overwritten - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_string +* +* Purpose: Creates and writes a string attribute named attr_name and attaches +* it to the object specified by the name obj_name. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: July 23, 2001 +* +* Comments: If the attribute already exists, it is overwritten +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_string( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const char *attr_data ) + const char *obj_name, + const char *attr_name, + const char *attr_data ) { - hid_t attr_type; - hid_t attr_space_id; - hid_t attr_id; - hid_t obj_id; - int has_attr; - size_t attr_size; + hid_t attr_type; + hid_t attr_space_id; + hid_t attr_id; + hid_t obj_id; + int has_attr; + size_t attr_size; - /* Open the object */ - if ((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the object */ + if ((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) + return -1; - /* Create the attribute */ - if ( (attr_type = H5Tcopy( H5T_C_S1 )) < 0 ) - goto out; + /* Create the attribute */ + if ( (attr_type = H5Tcopy( H5T_C_S1 )) < 0 ) + goto out; - attr_size = strlen( attr_data ) + 1; /* extra null term */ + attr_size = strlen( attr_data ) + 1; /* extra null term */ - if ( H5Tset_size( attr_type, (size_t)attr_size) < 0 ) - goto out; + if ( H5Tset_size( attr_type, (size_t)attr_size) < 0 ) + goto out; - if ( H5Tset_strpad( attr_type, H5T_STR_NULLTERM ) < 0 ) - goto out; + if ( H5Tset_strpad( attr_type, H5T_STR_NULLTERM ) < 0 ) + goto out; - if ( (attr_space_id = H5Screate( H5S_SCALAR )) < 0 ) - goto out; + if ( (attr_space_id = H5Screate( H5S_SCALAR )) < 0 ) + goto out; - /* Verify if the attribute already exists */ - has_attr = H5LT_find_attribute(obj_id, attr_name); + /* Verify if the attribute already exists */ + has_attr = H5LT_find_attribute(obj_id, attr_name); - /* The attribute already exists, delete it */ - if(has_attr == 1) - if(H5Adelete(obj_id, attr_name) < 0) - goto out; + /* The attribute already exists, delete it */ + if(has_attr == 1) + if(H5Adelete(obj_id, attr_name) < 0) + goto out; - /* Create and write the attribute */ + /* Create and write the attribute */ - if((attr_id = H5Acreate2(obj_id, attr_name, attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto out; + if((attr_id = H5Acreate2(obj_id, attr_name, attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; - if(H5Awrite(attr_id, attr_type, attr_data) < 0) - goto out; + if(H5Awrite(attr_id, attr_type, attr_data) < 0) + goto out; - if(H5Aclose(attr_id) < 0) - goto out; + if(H5Aclose(attr_id) < 0) + goto out; - if(H5Sclose(attr_space_id) < 0) - goto out; + if(H5Sclose(attr_space_id) < 0) + goto out; - if(H5Tclose(attr_type) < 0) - goto out; + if(H5Tclose(attr_type) < 0) + goto out; - /* Close the object */ - if(H5Oclose(obj_id) < 0) - return -1; + /* Close the object */ + if(H5Oclose(obj_id) < 0) + return -1; - return 0; + return 0; out: - H5Oclose(obj_id); - return -1; + H5Oclose(obj_id); + return -1; } @@ -920,185 +920,185 @@ out: /*------------------------------------------------------------------------- - * Function: H5LT_set_attribute_numerical - * - * Purpose: Private function used by H5LTset_attribute_int and H5LTset_attribute_float - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: July 25, 2001 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LT_set_attribute_numerical +* +* Purpose: Private function used by H5LTset_attribute_int and H5LTset_attribute_float +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: July 25, 2001 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LT_set_attribute_numerical( hid_t loc_id, - const char *obj_name, - const char *attr_name, - size_t size, - hid_t tid, - const void *data ) + const char *obj_name, + const char *attr_name, + size_t size, + hid_t tid, + const void *data ) { - hid_t obj_id, sid, attr_id; - hsize_t dim_size=size; - int has_attr; + hid_t obj_id, sid, attr_id; + hsize_t dim_size=size; + int has_attr; - /* Open the object */ - if ((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the object */ + if ((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) + return -1; - /* Create the data space for the attribute. */ - if ( (sid = H5Screate_simple( 1, &dim_size, NULL )) < 0 ) - goto out; + /* Create the data space for the attribute. */ + if ( (sid = H5Screate_simple( 1, &dim_size, NULL )) < 0 ) + goto out; - /* Verify if the attribute already exists */ - has_attr = H5LT_find_attribute(obj_id, attr_name); + /* Verify if the attribute already exists */ + has_attr = H5LT_find_attribute(obj_id, attr_name); - /* The attribute already exists, delete it */ - if(has_attr == 1) - if(H5Adelete(obj_id, attr_name) < 0) - goto out; + /* The attribute already exists, delete it */ + if(has_attr == 1) + if(H5Adelete(obj_id, attr_name) < 0) + goto out; - /* Create the attribute. */ - if((attr_id = H5Acreate2(obj_id, attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto out; + /* Create the attribute. */ + if((attr_id = H5Acreate2(obj_id, attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; - /* Write the attribute data. */ - if(H5Awrite(attr_id, tid, data) < 0) - goto out; + /* Write the attribute data. */ + if(H5Awrite(attr_id, tid, data) < 0) + goto out; - /* Close the attribute. */ - if(H5Aclose(attr_id) < 0) - goto out; + /* Close the attribute. */ + if(H5Aclose(attr_id) < 0) + goto out; - /* Close the dataspace. */ - if(H5Sclose(sid) < 0) - goto out; + /* Close the dataspace. */ + if(H5Sclose(sid) < 0) + goto out; - /* Close the object */ - if(H5Oclose(obj_id) < 0) - return -1; + /* Close the object */ + if(H5Oclose(obj_id) < 0) + return -1; - return 0; + return 0; out: - H5Oclose(obj_id); - return -1; + H5Oclose(obj_id); + return -1; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_char - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 7, 2001 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_char +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 7, 2001 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_char( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const char *data, - size_t size ) + const char *obj_name, + const char *attr_name, + const char *data, + size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_CHAR, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_CHAR, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_uchar - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 8, 2004 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_uchar +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 8, 2004 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_uchar( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const unsigned char *data, - size_t size ) + const char *obj_name, + const char *attr_name, + const unsigned char *data, + size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_UCHAR, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_UCHAR, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_short - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 7, 2001 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_short +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 7, 2001 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_short( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const short *data, - size_t size ) + const char *obj_name, + const char *attr_name, + const short *data, + size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_SHORT, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_SHORT, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_ushort - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 8, 2004 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_ushort +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 8, 2004 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_ushort( hid_t loc_id, const char *obj_name, @@ -1107,60 +1107,60 @@ herr_t H5LTset_attribute_ushort( hid_t loc_id, size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_USHORT, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_USHORT, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_int - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 7, 2001 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_int +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 7, 2001 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_int( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const int *data, - size_t size ) + const char *obj_name, + const char *attr_name, + const int *data, + size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_INT, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_INT, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_uint - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 8, 2004 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_uint +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 8, 2004 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_uint( hid_t loc_id, const char *obj_name, @@ -1169,92 +1169,92 @@ herr_t H5LTset_attribute_uint( hid_t loc_id, size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_UINT, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_UINT, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_long - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 7, 2001 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_long +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 7, 2001 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_long( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const long *data, - size_t size ) + const char *obj_name, + const char *attr_name, + const long *data, + size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_LONG, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_LONG, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_long_long - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu - * - * Date: June 17, 2005 - * - * Comments: This function was added to support attributes of type long long - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_long_long +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu +* +* Date: June 17, 2005 +* +* Comments: This function was added to support attributes of type long long +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_long_long( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const long long *data, - size_t size ) + const char *obj_name, + const char *attr_name, + const long long *data, + size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_LLONG, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_LLONG, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_ulong - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 8, 2004 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_ulong +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 8, 2004 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_ulong( hid_t loc_id, const char *obj_name, @@ -1263,99 +1263,99 @@ herr_t H5LTset_attribute_ulong( hid_t loc_id, size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_ULONG, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_ULONG, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_float - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: July 25, 2001 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_float +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: July 25, 2001 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_float( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const float *data, - size_t size ) + const char *obj_name, + const char *attr_name, + const float *data, + size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_FLOAT, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_FLOAT, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTset_attribute_double - * - * Purpose: Create and write an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 7, 2001 - * - * Comments: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTset_attribute_double +* +* Purpose: Create and write an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 7, 2001 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTset_attribute_double( hid_t loc_id, - const char *obj_name, - const char *attr_name, - const double *data, - size_t size ) + const char *obj_name, + const char *attr_name, + const double *data, + size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, - H5T_NATIVE_DOUBLE, data ) < 0 ) - return -1; + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + H5T_NATIVE_DOUBLE, data ) < 0 ) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: find_attr - * - * Purpose: operator function used by H5LT_find_attribute - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: June 21, 2001 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: find_attr +* +* Purpose: operator function used by H5LT_find_attribute +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: June 21, 2001 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ static herr_t find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, - void *op_data) + void *op_data) { int ret = H5_ITER_CONT; @@ -1363,9 +1363,9 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, loc_id = loc_id; ainfo = ainfo; /* Define a positive value for return value if the attribute was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success - */ + * cause the iterator to immediately return that positive value, + * indicating short-circuit success + */ if(strcmp(name, (char *)op_data) == 0) ret = H5_ITER_STOP; @@ -1374,51 +1374,51 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, /*------------------------------------------------------------------------- - * Function: H5LTfind_attribute - * - * Purpose: Inquires if an attribute named attr_name exists attached to - * the object loc_id. - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 17, 2006 - * - * Comments: - * Calls the private version of the function - * - *------------------------------------------------------------------------- - */ +* Function: H5LTfind_attribute +* +* Purpose: Inquires if an attribute named attr_name exists attached to +* the object loc_id. +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: May 17, 2006 +* +* Comments: +* Calls the private version of the function +* +*------------------------------------------------------------------------- +*/ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name ) { - return H5LT_find_attribute(loc_id,attr_name); + return H5LT_find_attribute(loc_id,attr_name); } /*------------------------------------------------------------------------- - * Function: H5LT_find_attribute - * - * Purpose: Inquires if an attribute named attr_name exists attached to the object loc_id. - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: June 21, 2001 - * - * Comments: - * The function uses H5Aiterate2 with the operator function find_attr - * - * Return: - * Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. - * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - *------------------------------------------------------------------------- - */ +* Function: H5LT_find_attribute +* +* Purpose: Inquires if an attribute named attr_name exists attached to the object loc_id. +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: June 21, 2001 +* +* Comments: +* The function uses H5Aiterate2 with the operator function find_attr +* +* Return: +* Success: The return value of the first operator that +* returns non-zero, or zero if all members were +* processed with no operator returning non-zero. +* +* Failure: Negative if something goes wrong within the +* library, or the negative value returned by one +* of the operators. +* +*------------------------------------------------------------------------- +*/ herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) @@ -1429,146 +1429,146 @@ H5LT_find_attribute( hid_t loc_id, const char* attr_name ) /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_ndims - * - * Purpose: Gets the dimensionality of an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 4, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_ndims +* +* Purpose: Gets the dimensionality of an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 4, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_ndims( hid_t loc_id, - const char *obj_name, - const char *attr_name, - int *rank ) + const char *obj_name, + const char *attr_name, + int *rank ) { - hid_t attr_id; - hid_t sid; - hid_t obj_id; + hid_t attr_id; + hid_t sid; + hid_t obj_id; - /* Open the object */ - if((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the object */ + if((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) + return -1; - /* Open the attribute. */ - if((attr_id = H5Aopen(obj_id, attr_name, H5P_DEFAULT)) < 0) - { - H5Oclose(obj_id); - return -1; - } + /* Open the attribute. */ + if((attr_id = H5Aopen(obj_id, attr_name, H5P_DEFAULT)) < 0) + { + H5Oclose(obj_id); + return -1; + } - /* Get the dataspace handle */ - if((sid = H5Aget_space(attr_id)) < 0) - goto out; + /* Get the dataspace handle */ + if((sid = H5Aget_space(attr_id)) < 0) + goto out; - /* Get rank */ - if((*rank = H5Sget_simple_extent_ndims(sid)) < 0) - goto out; + /* Get rank */ + if((*rank = H5Sget_simple_extent_ndims(sid)) < 0) + goto out; - /* Terminate access to the attribute */ - if ( H5Sclose( sid ) < 0 ) - goto out; + /* Terminate access to the attribute */ + if ( H5Sclose( sid ) < 0 ) + goto out; - /* End access to the attribute */ - if ( H5Aclose( attr_id ) ) - goto out;; + /* End access to the attribute */ + if ( H5Aclose( attr_id ) ) + goto out;; - /* Close the object */ - if(H5Oclose(obj_id) < 0 ) - return -1; + /* Close the object */ + if(H5Oclose(obj_id) < 0 ) + return -1; - return 0; + return 0; out: - H5Aclose( attr_id ); - H5Oclose(obj_id); - return -1; + H5Aclose( attr_id ); + H5Oclose(obj_id); + return -1; } /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_info - * - * Purpose: Gets information about an attribute. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 4, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_info +* +* Purpose: Gets information about an attribute. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 4, 2001 +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_info( hid_t loc_id, - const char *obj_name, - const char *attr_name, - hsize_t *dims, - H5T_class_t *type_class, - size_t *type_size ) + const char *obj_name, + const char *attr_name, + hsize_t *dims, + H5T_class_t *type_class, + size_t *type_size ) { - hid_t attr_id; - hid_t tid; - hid_t sid; - hid_t obj_id; + hid_t attr_id; + hid_t tid; + hid_t sid; + hid_t obj_id; - /* Open the object */ - if((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the object */ + if((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) + return -1; - /* Open the attribute. */ - if((attr_id = H5Aopen(obj_id, attr_name, H5P_DEFAULT)) < 0) - { - H5Oclose(obj_id); - return -1; - } + /* Open the attribute. */ + if((attr_id = H5Aopen(obj_id, attr_name, H5P_DEFAULT)) < 0) + { + H5Oclose(obj_id); + return -1; + } - /* Get an identifier for the datatype. */ - tid = H5Aget_type(attr_id); + /* Get an identifier for the datatype. */ + tid = H5Aget_type(attr_id); - /* Get the class. */ - *type_class = H5Tget_class(tid); + /* Get the class. */ + *type_class = H5Tget_class(tid); - /* Get the size. */ - *type_size = H5Tget_size( tid ); + /* Get the size. */ + *type_size = H5Tget_size( tid ); - /* Get the dataspace handle */ - if ( (sid = H5Aget_space( attr_id )) < 0 ) - goto out; + /* Get the dataspace handle */ + if ( (sid = H5Aget_space( attr_id )) < 0 ) + goto out; - /* Get dimensions */ - if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 ) - goto out; + /* Get dimensions */ + if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 ) + goto out; - /* Terminate access to the dataspace */ - if ( H5Sclose( sid ) < 0 ) - goto out; + /* Terminate access to the dataspace */ + if ( H5Sclose( sid ) < 0 ) + goto out; - /* Release the datatype. */ - if ( H5Tclose( tid ) ) - goto out; + /* Release the datatype. */ + if ( H5Tclose( tid ) ) + goto out; - /* End access to the attribute */ - if ( H5Aclose( attr_id ) ) - goto out; + /* End access to the attribute */ + if ( H5Aclose( attr_id ) ) + goto out; - /* Close the object */ - if(H5Oclose(obj_id) < 0 ) - return -1; + /* Close the object */ + if(H5Oclose(obj_id) < 0 ) + return -1; - return 0; + return 0; out: - H5Tclose(tid); - H5Aclose(attr_id); - H5Oclose(obj_id); - return -1; + H5Tclose(tid); + H5Aclose(attr_id); + H5Oclose(obj_id); + return -1; } @@ -1576,65 +1576,65 @@ out: /*------------------------------------------------------------------------- - * Function: H5LTtext_to_dtype - * - * Purpose: Convert DDL description to HDF5 data type. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Raymond Lu, slu@ncsa.uiuc.edu - * - * Date: October 6, 2004 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTtext_to_dtype +* +* Purpose: Convert DDL description to HDF5 data type. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* +* Date: October 6, 2004 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) { - extern int H5LTyyparse(void); - hid_t type_id; + extern int H5LTyyparse(void); + hid_t type_id; - if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG) - goto out; + if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG) + goto out; - if(lang_type != H5LT_DDL) { - fprintf(stderr, "only DDL is supported for now.\n"); - goto out; - } + if(lang_type != H5LT_DDL) { + fprintf(stderr, "only DDL is supported for now.\n"); + goto out; + } - input_len = strlen(text); - myinput = strdup(text); + input_len = strlen(text); + myinput = strdup(text); - if((type_id = H5LTyyparse()) < 0) - goto out; + if((type_id = H5LTyyparse()) < 0) + goto out; - free(myinput); - input_len = 0; + free(myinput); + input_len = 0; - return type_id; + return type_id; out: - return -1; + return -1; } /*------------------------------------------------------------------------- - * Function: indentation - * - * Purpose: Print spaces for indentation - * - * Return: void - * - * Programmer: Raymond Lu, slu@ncsa.uiuc.edu - * - * Date: December 6, 2005 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: indentation +* +* Purpose: Print spaces for indentation +* +* Return: void +* +* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* +* Date: December 6, 2005 +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ static void indentation(int x, char* str) { @@ -1648,17 +1648,17 @@ indentation(int x, char* str) } /*------------------------------------------------------------------------- - * Function: print_enum - * - * Purpose: prints the enum data - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Raymond Lu - * - * Modifications: - * - *-----------------------------------------------------------------------*/ +* Function: print_enum +* +* Purpose: prints the enum data +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Raymond Lu +* +* Modifications: +* +*-----------------------------------------------------------------------*/ static herr_t print_enum(hid_t type, char* str, int indt) { @@ -1682,9 +1682,9 @@ print_enum(hid_t type, char* str, int indt) goto out; /* Use buffer of INT or UNSIGNED INT to print enum values because - * we don't expect these values to be so big that INT or UNSIGNED - * INT can't hold. - */ + * we don't expect these values to be so big that INT or UNSIGNED + * INT can't hold. + */ if (H5T_SGN_NONE == H5Tget_sign(super)) { native = H5T_NATIVE_UINT; } else { @@ -1699,9 +1699,9 @@ print_enum(hid_t type, char* str, int indt) value = (unsigned char*)calloc((size_t)nmembs, MAX(dst_size, super_size)); for (i = 0; i < nmembs; i++) { - if((name[i] = H5Tget_member_name(type, (unsigned)i))==NULL) + if((name[i] = H5Tget_member_name(type, (unsigned)i))==NULL) goto out; - if(H5Tget_member_value(type, (unsigned)i, value + i * super_size) < 0) + if(H5Tget_member_value(type, (unsigned)i, value + i * super_size) < 0) goto out; } @@ -1712,45 +1712,45 @@ print_enum(hid_t type, char* str, int indt) } /* - * Sort members by increasing value - * ***not implemented yet*** - */ + * Sort members by increasing value + * ***not implemented yet*** + */ /* Print members */ for (i = 0; i < nmembs; i++) { - indentation(indt + COL, str); - nchars = sprintf(tmp_str, "\"%s\"", name[i]); + indentation(indt + COL, str); + nchars = sprintf(tmp_str, "\"%s\"", name[i]); strcat(str, tmp_str); - sprintf(tmp_str, "%*s ", MAX(0, 16 - nchars), ""); + sprintf(tmp_str, "%*s ", MAX(0, 16 - nchars), ""); strcat(str, tmp_str); - if (H5T_SGN_NONE == H5Tget_sign(native)) { - /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" - *strangely, unless use another pointer "copy".*/ - copy = value+i*dst_size; - sprintf(tmp_str,"%u", *((unsigned int*)((void *)copy))); + if (H5T_SGN_NONE == H5Tget_sign(native)) { + /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" + *strangely, unless use another pointer "copy".*/ + copy = value+i*dst_size; + sprintf(tmp_str,"%u", *((unsigned int*)((void *)copy))); strcat(str, tmp_str); - } else { - /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" - *strangely, unless use another pointer "copy".*/ - copy = value+i*dst_size; - sprintf(tmp_str,"%d", *((int*)((void *)copy))); + } else { + /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" + *strangely, unless use another pointer "copy".*/ + copy = value+i*dst_size; + sprintf(tmp_str,"%d", *((int*)((void *)copy))); strcat(str, tmp_str); - } + } - strcat(str, ";\n"); + strcat(str, ";\n"); } /* Release resources */ for (i = 0; i < nmembs; i++) - free(name[i]); + free(name[i]); free(name); free(value); H5Tclose(super); if (0 == nmembs) { - sprintf(tmp_str, "\n%*s ", indt + 4, ""); + sprintf(tmp_str, "\n%*s ", indt + 4, ""); strcat(str, tmp_str); } @@ -1761,22 +1761,22 @@ out: } /*------------------------------------------------------------------------- - * Function: H5LTdtype_to_text - * - * Purpose: Convert HDF5 data type to DDL description. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Raymond Lu, slu@ncsa.uiuc.edu - * - * Date: December 6, 2005 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTdtype_to_text +* +* Purpose: Convert HDF5 data type to DDL description. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* +* Date: December 6, 2005 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len) { size_t str_len = INCREMENT; @@ -1805,24 +1805,24 @@ out: } /*------------------------------------------------------------------------- - * Function: H5LT_dtype_to_text - * - * Purpose: Private function to convert HDF5 data type to DDL description. - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Raymond Lu, slu@ncsa.uiuc.edu - * - * Date: December 20, 2005 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LT_dtype_to_text +* +* Purpose: Private function to convert HDF5 data type to DDL description. +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* +* Date: December 20, 2005 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *slen, - hbool_t no_user_buf) + hbool_t no_user_buf) { H5T_class_t tcls; char tmp_str[256]; @@ -1834,8 +1834,8 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t * *slen += INCREMENT; tmp = (char*)realloc(*dt_str, *slen); if(tmp != *dt_str) { - free(*dt_str); - *dt_str = tmp; + free(*dt_str); + *dt_str = tmp; } } @@ -1930,150 +1930,150 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t * break; case H5T_STRING: { - /* Make a copy of type in memory in case when DTYPE is on disk, the size - * will be bigger than in memory. This makes it easier to compare - * types in memory. */ - hid_t str_type; - H5T_order_t order; - hid_t tmp_type; - size_t size; - H5T_str_t str_pad; - H5T_cset_t cset; - htri_t is_vlstr; - - if((tmp_type = H5Tcopy(dtype)) < 0) - goto out; - if((size = H5Tget_size(tmp_type))==0) - goto out; - if((str_pad = H5Tget_strpad(tmp_type)) < 0) - goto out; - if((cset = H5Tget_cset(tmp_type)) < 0) - goto out; - if((is_vlstr = H5Tis_variable_str(tmp_type)) < 0) - goto out; + /* Make a copy of type in memory in case when DTYPE is on disk, the size + * will be bigger than in memory. This makes it easier to compare + * types in memory. */ + hid_t str_type; + H5T_order_t order; + hid_t tmp_type; + size_t size; + H5T_str_t str_pad; + H5T_cset_t cset; + htri_t is_vlstr; + + if((tmp_type = H5Tcopy(dtype)) < 0) + goto out; + if((size = H5Tget_size(tmp_type))==0) + goto out; + if((str_pad = H5Tget_strpad(tmp_type)) < 0) + goto out; + if((cset = H5Tget_cset(tmp_type)) < 0) + goto out; + if((is_vlstr = H5Tis_variable_str(tmp_type)) < 0) + goto out; - /* Print lead-in */ - sprintf(*dt_str, "H5T_STRING {\n"); - indent += COL; + /* Print lead-in */ + sprintf(*dt_str, "H5T_STRING {\n"); + indent += COL; - indentation(indent + COL, *dt_str); + indentation(indent + COL, *dt_str); - if(is_vlstr) - strcat(*dt_str, "STRSIZE H5T_VARIABLE;\n"); - else { - sprintf(tmp_str, "STRSIZE %d;\n", (int)size); - strcat(*dt_str, tmp_str); - } + if(is_vlstr) + strcat(*dt_str, "STRSIZE H5T_VARIABLE;\n"); + else { + sprintf(tmp_str, "STRSIZE %d;\n", (int)size); + strcat(*dt_str, tmp_str); + } - indentation(indent + COL, *dt_str); + indentation(indent + COL, *dt_str); - if (str_pad == H5T_STR_NULLTERM) - strcat(*dt_str, "STRPAD H5T_STR_NULLTERM;\n"); - else if (str_pad == H5T_STR_NULLPAD) - strcat(*dt_str, "STRPAD H5T_STR_NULLPAD;\n"); - else if (str_pad == H5T_STR_SPACEPAD) - strcat(*dt_str, "STRPAD H5T_STR_SPACEPAD;\n"); - else - strcat(*dt_str, "STRPAD H5T_STR_ERROR;\n"); + if (str_pad == H5T_STR_NULLTERM) + strcat(*dt_str, "STRPAD H5T_STR_NULLTERM;\n"); + else if (str_pad == H5T_STR_NULLPAD) + strcat(*dt_str, "STRPAD H5T_STR_NULLPAD;\n"); + else if (str_pad == H5T_STR_SPACEPAD) + strcat(*dt_str, "STRPAD H5T_STR_SPACEPAD;\n"); + else + strcat(*dt_str, "STRPAD H5T_STR_ERROR;\n"); - indentation(indent + COL, *dt_str); + indentation(indent + COL, *dt_str); - if (cset == H5T_CSET_ASCII) - strcat(*dt_str, "CSET H5T_CSET_ASCII;\n"); - else if (cset == H5T_CSET_UTF8) - strcat(*dt_str, "CSET H5T_CSET_UTF8;\n"); - else - strcat(*dt_str, "CSET unknown;\n"); + if (cset == H5T_CSET_ASCII) + strcat(*dt_str, "CSET H5T_CSET_ASCII;\n"); + else if (cset == H5T_CSET_UTF8) + strcat(*dt_str, "CSET H5T_CSET_UTF8;\n"); + else + strcat(*dt_str, "CSET unknown;\n"); - /* Reproduce a C type string */ - if((str_type = H5Tcopy(H5T_C_S1)) < 0) - goto out; - if(is_vlstr) { - if(H5Tset_size(str_type, H5T_VARIABLE) < 0) + /* Reproduce a C type string */ + if((str_type = H5Tcopy(H5T_C_S1)) < 0) goto out; - } else { - if(H5Tset_size(str_type, size) < 0) + if(is_vlstr) { + if(H5Tset_size(str_type, H5T_VARIABLE) < 0) + goto out; + } else { + if(H5Tset_size(str_type, size) < 0) + goto out; + } + if(H5Tset_cset(str_type, cset) < 0) + goto out; + if(H5Tset_strpad(str_type, str_pad) < 0) goto out; - } - if(H5Tset_cset(str_type, cset) < 0) - goto out; - if(H5Tset_strpad(str_type, str_pad) < 0) - goto out; - indentation(indent + COL, *dt_str); + indentation(indent + COL, *dt_str); - /* Check C variable-length string first. Are the two types equal? */ - if (H5Tequal(tmp_type, str_type)) { - strcat(*dt_str, "CTYPE H5T_C_S1;\n"); - goto next; - } + /* Check C variable-length string first. Are the two types equal? */ + if (H5Tequal(tmp_type, str_type)) { + strcat(*dt_str, "CTYPE H5T_C_S1;\n"); + goto next; + } - /* Change the endianness and see if they're equal. */ - if((order = H5Tget_order(tmp_type)) < 0) - goto out; - if(order==H5T_ORDER_LE) { - if(H5Tset_order(str_type, H5T_ORDER_LE) < 0) + /* Change the endianness and see if they're equal. */ + if((order = H5Tget_order(tmp_type)) < 0) goto out; - } else if(order==H5T_ORDER_BE) { - if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + if(order==H5T_ORDER_LE) { + if(H5Tset_order(str_type, H5T_ORDER_LE) < 0) + goto out; + } else if(order==H5T_ORDER_BE) { + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + goto out; + } + + if (H5Tequal(tmp_type, str_type)) { + strcat(*dt_str, "H5T_C_S1;\n"); + goto next; + } + + /* If not equal to C variable-length string, check Fortran type. + * Actually H5Tequal can't tell difference between H5T_C_S1 and H5T_FORTRAN_S1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ + if(H5Tclose(str_type) < 0) goto out; - } - - if (H5Tequal(tmp_type, str_type)) { - strcat(*dt_str, "H5T_C_S1;\n"); - goto next; - } - - /* If not equal to C variable-length string, check Fortran type. - * Actually H5Tequal can't tell difference between H5T_C_S1 and H5T_FORTRAN_S1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ - if(H5Tclose(str_type) < 0) - goto out; - if((str_type = H5Tcopy(H5T_FORTRAN_S1)) < 0) - goto out; - if(H5Tset_cset(str_type, cset) < 0) - goto out; - if(H5Tset_size(str_type, size) < 0) - goto out; - if(H5Tset_strpad(str_type, str_pad) < 0) - goto out; - - /* Are the two types equal? */ - if (H5Tequal(tmp_type, str_type)) { - strcat(*dt_str, "CTYPE H5T_FORTRAN_S1;\n"); - goto next; - } - - /* Change the endianness and see if they're equal. */ - if((order = H5Tget_order(tmp_type)) < 0) - goto out; - if(order==H5T_ORDER_LE) { - if(H5Tset_order(str_type, H5T_ORDER_LE) < 0) + if((str_type = H5Tcopy(H5T_FORTRAN_S1)) < 0) goto out; - } else if(order==H5T_ORDER_BE) { - if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + if(H5Tset_cset(str_type, cset) < 0) + goto out; + if(H5Tset_size(str_type, size) < 0) + goto out; + if(H5Tset_strpad(str_type, str_pad) < 0) goto out; - } - /* Are the two types equal? */ - if (H5Tequal(tmp_type, str_type)) { - strcat(*dt_str, "CTYPE H5T_FORTRAN_S1;\n"); - goto next; - } + /* Are the two types equal? */ + if (H5Tequal(tmp_type, str_type)) { + strcat(*dt_str, "CTYPE H5T_FORTRAN_S1;\n"); + goto next; + } - /* Type doesn't match any of above. */ - strcat(*dt_str, "CTYPE unknown_one_character_type;\n "); + /* Change the endianness and see if they're equal. */ + if((order = H5Tget_order(tmp_type)) < 0) + goto out; + if(order==H5T_ORDER_LE) { + if(H5Tset_order(str_type, H5T_ORDER_LE) < 0) + goto out; + } else if(order==H5T_ORDER_BE) { + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + goto out; + } + + /* Are the two types equal? */ + if (H5Tequal(tmp_type, str_type)) { + strcat(*dt_str, "CTYPE H5T_FORTRAN_S1;\n"); + goto next; + } + + /* Type doesn't match any of above. */ + strcat(*dt_str, "CTYPE unknown_one_character_type;\n "); next: - H5Tclose(str_type); - H5Tclose(tmp_type); + H5Tclose(str_type); + H5Tclose(tmp_type); - /* Print closing */ - indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + /* Print closing */ + indent -= COL; + indentation(indent + COL, *dt_str); + strcat(*dt_str, "}"); - break; + break; } case H5T_OPAQUE: /* Print lead-in */ @@ -2096,166 +2096,166 @@ next: break; case H5T_ENUM: { - hid_t super; - size_t super_len; - char* stmp; + hid_t super; + size_t super_len; + char* stmp; - /* Print lead-in */ - sprintf(*dt_str, "H5T_ENUM {\n"); - indent += COL; - indentation(indent + COL, *dt_str); + /* Print lead-in */ + sprintf(*dt_str, "H5T_ENUM {\n"); + indent += COL; + indentation(indent + COL, *dt_str); - if((super = H5Tget_super(dtype)) < 0) - goto out; - if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) - goto out; - stmp = (char*)calloc(super_len, sizeof(char)); - if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) - goto out; - strcat(*dt_str, stmp); - free(stmp); - strcat(*dt_str, ";\n"); - H5Tclose(super); - - if(print_enum(dtype, *dt_str, indent) < 0) - goto out; + if((super = H5Tget_super(dtype)) < 0) + goto out; + if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) + goto out; + stmp = (char*)calloc(super_len, sizeof(char)); + if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) + goto out; + strcat(*dt_str, stmp); + free(stmp); + strcat(*dt_str, ";\n"); + H5Tclose(super); - /* Print closing */ - indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + if(print_enum(dtype, *dt_str, indent) < 0) + goto out; - break; + /* Print closing */ + indent -= COL; + indentation(indent + COL, *dt_str); + strcat(*dt_str, "}"); + + break; } case H5T_VLEN: { - hid_t super; - size_t super_len; - char* stmp; + hid_t super; + size_t super_len; + char* stmp; - /* Print lead-in */ - sprintf(*dt_str, "H5T_VLEN {\n"); - indent += COL; - indentation(indent + COL, *dt_str); + /* Print lead-in */ + sprintf(*dt_str, "H5T_VLEN {\n"); + indent += COL; + indentation(indent + COL, *dt_str); - if((super = H5Tget_super(dtype)) < 0) - goto out; - if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) - goto out; - stmp = (char*)calloc(super_len, sizeof(char)); - if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) - goto out; - strcat(*dt_str, stmp); - free(stmp); - strcat(*dt_str, "\n"); - H5Tclose(super); + if((super = H5Tget_super(dtype)) < 0) + goto out; + if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) + goto out; + stmp = (char*)calloc(super_len, sizeof(char)); + if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) + goto out; + strcat(*dt_str, stmp); + free(stmp); + strcat(*dt_str, "\n"); + H5Tclose(super); - /* Print closing */ - indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + /* Print closing */ + indent -= COL; + indentation(indent + COL, *dt_str); + strcat(*dt_str, "}"); - break; + break; } case H5T_ARRAY: { - hid_t super; - size_t super_len; - char* stmp; - hsize_t dims[H5S_MAX_RANK]; - int ndims; - - /* Print lead-in */ - sprintf(*dt_str, "H5T_ARRAY {\n"); - indent += COL; - indentation(indent + COL, *dt_str); - - /* Get array information */ - if((ndims = H5Tget_array_ndims(dtype)) < 0) - goto out; - if(H5Tget_array_dims2(dtype, dims) < 0) - goto out; - - /* Print array dimensions */ - for (i = 0; i < ndims; i++) { - sprintf(tmp_str, "[%d]", (int) dims[i]); - strcat(*dt_str, tmp_str); - } - strcat(*dt_str, " "); - - if((super = H5Tget_super(dtype)) < 0) - goto out; - if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) - goto out; - stmp = (char*)calloc(super_len, sizeof(char)); - if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) - goto out; - strcat(*dt_str, stmp); - free(stmp); - strcat(*dt_str, "\n"); - H5Tclose(super); - - /* Print closing */ - indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); - - break; - } - case H5T_COMPOUND: - { - char *mname; - hid_t mtype; - size_t moffset; - H5T_class_t mclass; - size_t mlen; - char* mtmp; - int nmembs; - - if((nmembs = H5Tget_nmembers(dtype)) < 0) - goto out; - - sprintf(*dt_str, "H5T_COMPOUND {\n"); - indent += COL; + hid_t super; + size_t super_len; + char* stmp; + hsize_t dims[H5S_MAX_RANK]; + int ndims; + + /* Print lead-in */ + sprintf(*dt_str, "H5T_ARRAY {\n"); + indent += COL; + indentation(indent + COL, *dt_str); - for (i = 0; i < nmembs; i++) { - if((mname = H5Tget_member_name(dtype, (unsigned)i))==NULL) + /* Get array information */ + if((ndims = H5Tget_array_ndims(dtype)) < 0) goto out; - if((mtype = H5Tget_member_type(dtype, (unsigned)i)) < 0) + if(H5Tget_array_dims2(dtype, dims) < 0) goto out; - moffset = H5Tget_member_offset(dtype, (unsigned)i); - indentation(indent + COL, *dt_str); - if((mclass = H5Tget_class(mtype)) < 0) - goto out; - if (H5T_COMPOUND == mclass) - indent += COL; + /* Print array dimensions */ + for (i = 0; i < ndims; i++) { + sprintf(tmp_str, "[%d]", (int) dims[i]); + strcat(*dt_str, tmp_str); + } + strcat(*dt_str, " "); - if(H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0) + if((super = H5Tget_super(dtype)) < 0) goto out; - mtmp = (char*)calloc(mlen, sizeof(char)); - if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) + if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - strcat(*dt_str, mtmp); - free(mtmp); - - if (H5T_COMPOUND == mclass) - indent -= COL; + stmp = (char*)calloc(super_len, sizeof(char)); + if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) + goto out; + strcat(*dt_str, stmp); + free(stmp); + strcat(*dt_str, "\n"); + H5Tclose(super); - sprintf(tmp_str, " \"%s\"", mname); - strcat(*dt_str, tmp_str); - free(mname); + /* Print closing */ + indent -= COL; + indentation(indent + COL, *dt_str); + strcat(*dt_str, "}"); - sprintf(tmp_str, " : %lu;\n", (unsigned long)moffset); - strcat(*dt_str, tmp_str); + break; } + case H5T_COMPOUND: + { + char *mname; + hid_t mtype; + size_t moffset; + H5T_class_t mclass; + size_t mlen; + char* mtmp; + int nmembs; + + if((nmembs = H5Tget_nmembers(dtype)) < 0) + goto out; - /* Print closing */ - indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + sprintf(*dt_str, "H5T_COMPOUND {\n"); + indent += COL; + + for (i = 0; i < nmembs; i++) { + if((mname = H5Tget_member_name(dtype, (unsigned)i))==NULL) + goto out; + if((mtype = H5Tget_member_type(dtype, (unsigned)i)) < 0) + goto out; + moffset = H5Tget_member_offset(dtype, (unsigned)i); + indentation(indent + COL, *dt_str); + + if((mclass = H5Tget_class(mtype)) < 0) + goto out; + if (H5T_COMPOUND == mclass) + indent += COL; + + if(H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0) + goto out; + mtmp = (char*)calloc(mlen, sizeof(char)); + if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) + goto out; + strcat(*dt_str, mtmp); + free(mtmp); + + if (H5T_COMPOUND == mclass) + indent -= COL; + + sprintf(tmp_str, " \"%s\"", mname); + strcat(*dt_str, tmp_str); + free(mname); + + sprintf(tmp_str, " : %lu;\n", (unsigned long)moffset); + strcat(*dt_str, tmp_str); + } + + /* Print closing */ + indent -= COL; + indentation(indent + COL, *dt_str); + strcat(*dt_str, "}"); - break; + break; } case H5T_TIME: sprintf(*dt_str, "H5T_TIME: not yet implemented"); @@ -2278,77 +2278,77 @@ out: /*------------------------------------------------------------------------- - * - * Get attribute functions - * - *------------------------------------------------------------------------- - */ +* +* Get attribute functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_string - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_string +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_string( hid_t loc_id, - const char *obj_name, - const char *attr_name, - char *data ) + const char *obj_name, + const char *attr_name, + char *data ) { - /* identifiers */ - hid_t obj_id; + /* identifiers */ + hid_t obj_id; - /* Open the object */ - if ((obj_id = H5Oopen( loc_id, obj_name, H5P_DEFAULT)) < 0) - return -1; + /* Open the object */ + if ((obj_id = H5Oopen( loc_id, obj_name, H5P_DEFAULT)) < 0) + return -1; - /* Get the attribute */ - if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 ) + return -1; - /* Close the object */ - if(H5Oclose(obj_id) < 0) - return -1; + /* Close the object */ + if(H5Oclose(obj_id) < 0) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_char - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_char +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_char( hid_t loc_id, - const char *obj_name, - const char *attr_name, - char *data ) + const char *obj_name, + const char *attr_name, + char *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_CHAR, data) < 0) @@ -2358,26 +2358,26 @@ herr_t H5LTget_attribute_char( hid_t loc_id, } /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_uchar - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 8, 2004 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_uchar +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 8, 2004 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_uchar( hid_t loc_id, - const char *obj_name, - const char *attr_name, - unsigned char *data ) + const char *obj_name, + const char *attr_name, + unsigned char *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_UCHAR, data) < 0) @@ -2389,26 +2389,26 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_short - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_short +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_short( hid_t loc_id, - const char *obj_name, - const char *attr_name, - short *data ) + const char *obj_name, + const char *attr_name, + short *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_SHORT, data) < 0) @@ -2418,22 +2418,22 @@ herr_t H5LTget_attribute_short( hid_t loc_id, } /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_ushort - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 8, 2004 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_ushort +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 8, 2004 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_ushort( hid_t loc_id, const char *obj_name, const char *attr_name, @@ -2449,26 +2449,26 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_int - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_int +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_int( hid_t loc_id, - const char *obj_name, - const char *attr_name, - int *data ) + const char *obj_name, + const char *attr_name, + int *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_INT, data) < 0) @@ -2478,22 +2478,22 @@ herr_t H5LTget_attribute_int( hid_t loc_id, } /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_uint - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 8, 2004 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_uint +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 8, 2004 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_uint( hid_t loc_id, const char *obj_name, const char *attr_name, @@ -2509,22 +2509,22 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_long - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_long +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_long( hid_t loc_id, const char *obj_name, const char *attr_name, @@ -2538,26 +2538,26 @@ herr_t H5LTget_attribute_long( hid_t loc_id, } /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_long_long - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu - * - * Date: June 17, 2005 - * - * Comments: This funstion was added to suuport INTEGER*8 Fortran types - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_long_long +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu +* +* Date: June 17, 2005 +* +* Comments: This funstion was added to suuport INTEGER*8 Fortran types +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_long_long( hid_t loc_id, - const char *obj_name, - const char *attr_name, - long long *data ) + const char *obj_name, + const char *attr_name, + long long *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_LLONG, data) < 0) @@ -2568,26 +2568,26 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_ulong - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 8, 2004 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_ulong +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 8, 2004 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_ulong( hid_t loc_id, - const char *obj_name, - const char *attr_name, - unsigned long *data ) + const char *obj_name, + const char *attr_name, + unsigned long *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_ULONG, data) < 0) @@ -2598,28 +2598,28 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_float - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_float +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_float( hid_t loc_id, - const char *obj_name, - const char *attr_name, - float *data ) + const char *obj_name, + const char *attr_name, + float *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_FLOAT, data) < 0) @@ -2630,28 +2630,28 @@ herr_t H5LTget_attribute_float( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTget_attribute_double - * - * Purpose: Reads an attribute named attr_name - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute_double +* +* Purpose: Reads an attribute named attr_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute_double( hid_t loc_id, - const char *obj_name, - const char *attr_name, - double *data ) + const char *obj_name, + const char *attr_name, + double *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_DOUBLE, data) < 0) @@ -2662,29 +2662,29 @@ herr_t H5LTget_attribute_double( hid_t loc_id, /*------------------------------------------------------------------------- - * Function: H5LTget_attribute - * - * Purpose: Reads an attribute named attr_name with the memory type mem_type_id - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: Private function - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LTget_attribute +* +* Purpose: Reads an attribute named attr_name with the memory type mem_type_id +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: Private function +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LTget_attribute( hid_t loc_id, - const char *obj_name, - const char *attr_name, - hid_t mem_type_id, - void *data ) + const char *obj_name, + const char *attr_name, + hid_t mem_type_id, + void *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, mem_type_id, data) < 0) @@ -2695,35 +2695,35 @@ herr_t H5LTget_attribute( hid_t loc_id, /*------------------------------------------------------------------------- - * private functions - *------------------------------------------------------------------------- - */ +* private functions +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5LT_get_attribute_mem - * - * Purpose: Reads an attribute named attr_name with the memory type mem_type_id - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: Private function - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LT_get_attribute_mem +* +* Purpose: Reads an attribute named attr_name with the memory type mem_type_id +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: Private function +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ static herr_t H5LT_get_attribute_mem(hid_t loc_id, - const char *obj_name, - const char *attr_name, - hid_t mem_type_id, - void *data) + const char *obj_name, + const char *attr_name, + hid_t mem_type_id, + void *data) { /* identifiers */ hid_t obj_id = -1; @@ -2745,7 +2745,7 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id, /* Close the object */ if(H5Oclose(obj_id) < 0) - goto out; + goto out; obj_id = -1; return 0; @@ -2757,138 +2757,138 @@ out: } /*------------------------------------------------------------------------- - * Function: H5LT_get_attribute_disk - * - * Purpose: Reads an attribute named attr_name with the datatype stored on disk - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September 19, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LT_get_attribute_disk +* +* Purpose: Reads an attribute named attr_name with the datatype stored on disk +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September 19, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LT_get_attribute_disk( hid_t loc_id, - const char *attr_name, - void *attr_out ) + const char *attr_name, + void *attr_out ) { - /* identifiers */ - hid_t attr_id; - hid_t attr_type; + /* identifiers */ + hid_t attr_id; + hid_t attr_type; - if(( attr_id = H5Aopen(loc_id, attr_name, H5P_DEFAULT)) < 0) - return -1; + if(( attr_id = H5Aopen(loc_id, attr_name, H5P_DEFAULT)) < 0) + return -1; - if((attr_type = H5Aget_type(attr_id)) < 0) - goto out; + if((attr_type = H5Aget_type(attr_id)) < 0) + goto out; - if(H5Aread(attr_id, attr_type, attr_out) < 0) - goto out; + if(H5Aread(attr_id, attr_type, attr_out) < 0) + goto out; - if(H5Tclose(attr_type) < 0) - goto out; + if(H5Tclose(attr_type) < 0) + goto out; - if ( H5Aclose( attr_id ) < 0 ) - return -1;; + if ( H5Aclose( attr_id ) < 0 ) + return -1;; - return 0; + return 0; out: - H5Tclose( attr_type ); - H5Aclose( attr_id ); - return -1; + H5Tclose( attr_type ); + H5Aclose( attr_id ); + return -1; } /*------------------------------------------------------------------------- - * Function: H5LT_set_attribute_string - * - * Purpose: creates and writes an attribute named NAME to the dataset DSET_ID - * - * Return: FAIL on error, SUCCESS on success - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: January 04, 2005 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5LT_set_attribute_string +* +* Purpose: creates and writes an attribute named NAME to the dataset DSET_ID +* +* Return: FAIL on error, SUCCESS on success +* +* Programmer: pvn@ncsa.uiuc.edu +* +* Date: January 04, 2005 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5LT_set_attribute_string(hid_t dset_id, const char *name, const char *buf ) { - hid_t tid; - hid_t sid = -1; - hid_t aid = -1; - int has_attr; - size_t size; - - /* verify if the attribute already exists */ - has_attr = H5LT_find_attribute(dset_id,name); - - /* the attribute already exists, delete it */ - if(has_attr == 1) - if(H5Adelete(dset_id, name) < 0) - return FAIL; + hid_t tid; + hid_t sid = -1; + hid_t aid = -1; + int has_attr; + size_t size; -/*------------------------------------------------------------------------- - * create the attribute type - *------------------------------------------------------------------------- - */ - if((tid = H5Tcopy(H5T_C_S1)) < 0) - return FAIL; + /* verify if the attribute already exists */ + has_attr = H5LT_find_attribute(dset_id,name); - size = strlen(buf) + 1; /* extra null term */ + /* the attribute already exists, delete it */ + if(has_attr == 1) + if(H5Adelete(dset_id, name) < 0) + return FAIL; - if(H5Tset_size(tid,(size_t)size) < 0) - goto out; + /*------------------------------------------------------------------------- + * create the attribute type + *------------------------------------------------------------------------- + */ + if((tid = H5Tcopy(H5T_C_S1)) < 0) + return FAIL; - if(H5Tset_strpad(tid, H5T_STR_NULLTERM) < 0) - goto out; + size = strlen(buf) + 1; /* extra null term */ - if((sid = H5Screate(H5S_SCALAR)) < 0) - goto out; + if(H5Tset_size(tid,(size_t)size) < 0) + goto out; + if(H5Tset_strpad(tid, H5T_STR_NULLTERM) < 0) + goto out; -/*------------------------------------------------------------------------- - * create and write the attribute - *------------------------------------------------------------------------- - */ - if((aid = H5Acreate2(dset_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto out; + if((sid = H5Screate(H5S_SCALAR)) < 0) + goto out; - if(H5Awrite(aid, tid, buf) < 0) - goto out; - if(H5Aclose(aid) < 0) - goto out; + /*------------------------------------------------------------------------- + * create and write the attribute + *------------------------------------------------------------------------- + */ + if((aid = H5Acreate2(dset_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; - if(H5Sclose(sid) < 0) - goto out; + if(H5Awrite(aid, tid, buf) < 0) + goto out; - if(H5Tclose(tid) < 0) - goto out; + if(H5Aclose(aid) < 0) + goto out; - return SUCCEED; + if(H5Sclose(sid) < 0) + goto out; + + if(H5Tclose(tid) < 0) + goto out; + + return SUCCEED; - /* error zone, gracefully close */ + /* error zone */ out: - H5E_BEGIN_TRY { - H5Aclose(aid); - H5Tclose(tid); - H5Sclose(sid); - } H5E_END_TRY; - return FAIL; + H5E_BEGIN_TRY { + H5Aclose(aid); + H5Tclose(tid); + H5Sclose(sid); + } H5E_END_TRY; + return FAIL; } diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 30a8490..a035319 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -20,11 +20,11 @@ /*------------------------------------------------------------------------- - * - * internal functions - * - *------------------------------------------------------------------------- - */ +* +* internal functions +* +*------------------------------------------------------------------------- +*/ static int H5TB_find_field(const char *field, const char *field_list); @@ -43,47 +43,47 @@ static hid_t H5TB_create_type(hid_t loc_id, hid_t ftype_id); /*------------------------------------------------------------------------- - * - * Create functions - * - *------------------------------------------------------------------------- - */ +* +* Create functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5TBmake_table - * - * Purpose: Make a table - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * Quincey Koziol - * - * Date: January 17, 2001 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5TBmake_table +* +* Purpose: Make a table +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Quincey Koziol +* +* Date: January 17, 2001 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5TBmake_table( const char *table_title, - hid_t loc_id, - const char *dset_name, - hsize_t nfields, - hsize_t nrecords, - size_t type_size, - const char *field_names[], - const size_t *field_offset, - const hid_t *field_types, - hsize_t chunk_size, - void *fill_data, - int compress, - const void *buf ) + hid_t loc_id, + const char *dset_name, + hsize_t nfields, + hsize_t nrecords, + size_t type_size, + const char *field_names[], + const size_t *field_offset, + const hid_t *field_types, + hsize_t chunk_size, + void *fill_data, + int compress, + const void *buf ) { - + hid_t did; hid_t sid; hid_t mem_type_id; @@ -97,37 +97,37 @@ herr_t H5TBmake_table( const char *table_title, char aux[255]; hsize_t i; unsigned char *tmp_buf; - + dims[0] = nrecords; dims_chunk[0] = chunk_size; - + /* create the memory data type. */ if ((mem_type_id = H5Tcreate (H5T_COMPOUND, type_size )) < 0) return -1; - + /* insert fields. */ for ( i = 0; i < nfields; i++) { if(H5Tinsert(mem_type_id, field_names[i], field_offset[i], field_types[i] ) < 0) return -1; } - + /* create a simple data space with unlimited size */ if ((sid = H5Screate_simple( 1, dims, maxdims )) < 0) return -1; - + /* modify dataset creation properties, i.e. enable chunking */ plist_id = H5Pcreate(H5P_DATASET_CREATE); if (H5Pset_chunk(plist_id, 1, dims_chunk) < 0) return -1; - + /* set the fill value using a struct as the data type. */ if (fill_data) { if(H5Pset_fill_value(plist_id, mem_type_id, fill_data) < 0) return -1; } - + /* dataset creation property list is modified to use GZIP compression with the compression effort set to 6. @@ -137,11 +137,11 @@ herr_t H5TBmake_table( const char *table_title, if(H5Pset_deflate(plist_id, 6) < 0) return -1; } - + /* create the dataset. */ if ((did = H5Dcreate2(loc_id, dset_name, mem_type_id, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) goto out; - + /* only write if there is something to write */ if (buf) { @@ -149,108 +149,108 @@ herr_t H5TBmake_table( const char *table_title, if (H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf ) < 0) goto out; } - + /* terminate access to the data space. */ if (H5Sclose(sid) < 0) goto out; - + /* end access to the dataset */ if (H5Dclose(did) < 0) goto out; - + /* end access to the property list */ if (H5Pclose(plist_id) < 0) goto out; - + /*------------------------------------------------------------------------- * set the conforming table attributes *------------------------------------------------------------------------- */ - + /* attach the CLASS attribute */ if (H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0) goto out; - + /* attach the VERSION attribute */ if (H5LTset_attribute_string( loc_id, dset_name, "VERSION", TABLE_VERSION ) < 0) goto out; - + /* attach the TITLE attribute */ if (H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0) goto out; - + /* attach the FIELD_ name attribute */ for ( i = 0; i < nfields; i++) { /* get the member name */ member_name = H5Tget_member_name( mem_type_id,(unsigned) i ); - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int)i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_NAME" ); strcat( attr_name, aux ); - + /* attach the attribute */ if (H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0) goto out; - + free( member_name ); - + } - + /* attach the FIELD_ fill value attribute */ if (fill_data ) { - - tmp_buf = fill_data; - + + tmp_buf = (unsigned char *) fill_data; + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + if (( sid = H5Screate(H5S_SCALAR)) < 0) goto out; - + for ( i = 0; i < nfields; i++) { - + /* get the member name */ member_name = H5Tget_member_name(mem_type_id, (unsigned)i); - + strcpy(attr_name, "FIELD_"); sprintf(aux, "%d", (int)i); strcat(attr_name, aux); sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - + if ((attr_id = H5Acreate2(did, attr_name, field_types[i], sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - + if (H5Awrite(attr_id, field_types[i], tmp_buf+field_offset[i]) < 0) goto out; - + if (H5Aclose(attr_id) < 0) goto out; - + free(member_name); } - + /* terminate access to the data space. */ if (H5Sclose(sid) < 0) goto out; - + /* end access to the dataset */ if (H5Dclose(did) < 0) goto out; } - + /* release the datatype. */ if (H5Tclose( mem_type_id ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY { @@ -260,45 +260,45 @@ out: H5Tclose(mem_type_id); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * - * Write functions - * - *------------------------------------------------------------------------- - */ +* +* Write functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5TBappend_records - * - * Purpose: Appends records to a table - * - * Return: Success: 0, Failure: -1 - * - * Programmers: - * Pedro Vicente, pvn@ncsa.uiuc.edu - * Quincey Koziol - * - * Date: November 19, 2001 - * - * Comments: Uses memory offsets - * - * Modifications: April 1, 2004 - * the FIELD_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type - * - *------------------------------------------------------------------------- - */ +* Function: H5TBappend_records +* +* Purpose: Appends records to a table +* +* Return: Success: 0, Failure: -1 +* +* Programmers: +* Pedro Vicente, pvn@ncsa.uiuc.edu +* Quincey Koziol +* +* Date: November 19, 2001 +* +* Comments: Uses memory offsets +* +* Modifications: April 1, 2004 +* the FIELD_SIZES parameter is used to define the memory type ID +* returned by H5TB_create_type +* +*------------------------------------------------------------------------- +*/ herr_t H5TBappend_records( hid_t loc_id, - const char *dset_name, - hsize_t nrecords, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - const void *buf ) + const char *dset_name, + hsize_t nrecords, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + const void *buf ) { hid_t did; hid_t tid=-1; @@ -307,26 +307,26 @@ herr_t H5TBappend_records( hid_t loc_id, hid_t m_sid=-1; hsize_t nrecords_orig; hsize_t nfields; - + /* get the original number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords_orig ) < 0) return -1; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) goto out; - + /* get the datatypes */ if ((tid = H5Dget_type( did )) < 0) goto out; - + if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid)) < 0) goto out; - + /* append the records */ if ((H5TB_common_append_records(did, mem_type_id, (size_t)nrecords, nrecords_orig, buf)) < 0) goto out; - + /* close */ if (H5Tclose( tid ) < 0) return -1; @@ -334,9 +334,9 @@ herr_t H5TBappend_records( hid_t loc_id, goto out; if (H5Dclose( did ) < 0) goto out; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -351,36 +351,36 @@ out: } /*------------------------------------------------------------------------- - * Function: H5TBwrite_records - * - * Purpose: Writes records - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 19, 2001 - * - * Comments: Uses memory offsets - * - * Modifications: April 1, 2004 - * the FIELD_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type - * - *------------------------------------------------------------------------- - */ +* Function: H5TBwrite_records +* +* Purpose: Writes records +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 19, 2001 +* +* Comments: Uses memory offsets +* +* Modifications: April 1, 2004 +* the FIELD_SIZES parameter is used to define the memory type ID +* returned by H5TB_create_type +* +*------------------------------------------------------------------------- +*/ herr_t H5TBwrite_records( hid_t loc_id, - const char *dset_name, - hsize_t start, - hsize_t nrecords, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - const void *buf ) + const char *dset_name, + hsize_t start, + hsize_t nrecords, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + const void *buf ) { - + hid_t did; hid_t tid; hsize_t count[1]; @@ -390,43 +390,43 @@ herr_t H5TBwrite_records( hid_t loc_id, hsize_t mem_size[1]; hsize_t dims[1]; hid_t mem_type_id=-1; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /* get the datatype */ if ((tid = H5Dget_type( did )) < 0) goto out; - + if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid)) < 0) goto out; - + /* get the dataspace handle */ if ((sid = H5Dget_space( did )) < 0) goto out; - + /* get records */ if (H5Sget_simple_extent_dims( sid, dims, NULL) < 0) goto out; - + if (start + nrecords > dims[0] ) goto out; - + /* define a hyperslab in the dataset of the size of the records */ offset[0] = start; count[0] = nrecords; if (H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((m_sid = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; - + if (H5Dwrite( did, mem_type_id, m_sid, sid, H5P_DEFAULT, buf ) < 0) goto out; - + /* close */ if (H5Sclose( m_sid ) < 0) goto out; @@ -438,9 +438,9 @@ herr_t H5TBwrite_records( hid_t loc_id, return -1; if (H5Dclose( did ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -455,32 +455,32 @@ out: } /*------------------------------------------------------------------------- - * Function: H5TBwrite_fields_name - * - * Purpose: Writes fields - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 21, 2001 - * - * Comments: - * - * Modifications: April 1, 2004 - * the FIELD_SIZES parameter is used to define a memory type ID - * - *------------------------------------------------------------------------- - */ +* Function: H5TBwrite_fields_name +* +* Purpose: Writes fields +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 21, 2001 +* +* Comments: +* +* Modifications: April 1, 2004 +* the FIELD_SIZES parameter is used to define a memory type ID +* +*------------------------------------------------------------------------- +*/ herr_t H5TBwrite_fields_name( hid_t loc_id, - const char *dset_name, - const char *field_names, - hsize_t start, - hsize_t nrecords, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - const void *buf ) + const char *dset_name, + const char *field_names, + hsize_t start, + hsize_t nrecords, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + const void *buf ) { hid_t did; hid_t tid=-1; @@ -496,57 +496,57 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, hssize_t i, j; hid_t preserve_id; size_t size_native; - + /* create xfer properties to preserve initialized data */ if ((preserve_id = H5Pcreate (H5P_DATASET_XFER)) < 0) return -1; if (H5Pset_preserve (preserve_id, 1) < 0) return -1; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) goto out; - + /* get the datatype */ if ((tid = H5Dget_type( did )) < 0) goto out; - + /* get the number of fields */ if (( nfields = H5Tget_nmembers( tid )) < 0) goto out; - + /* create a write id */ if (( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0) goto out; - + j = 0; - + /* iterate tru the members */ for ( i = 0; i < nfields; i++) { /* get the member name */ member_name = H5Tget_member_name( tid, (unsigned)i ); - + if(H5TB_find_field( member_name, field_names ) > 0 ) { - + /* get the member type */ if(( member_type_id = H5Tget_member_type( tid,(unsigned) i )) < 0) goto out; - + /* convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT)) < 0) goto out; - + size_native=H5Tget_size(nmtype_id); - + /* adjust, if necessary */ if (field_sizes[j]!=size_native) { if (H5Tset_size(nmtype_id, field_sizes[j]) < 0) goto out; } - + /* the field in the file is found by its name */ if (field_offset ) { @@ -559,36 +559,36 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, if (H5Tinsert( write_type_id, member_name, (size_t)0, nmtype_id ) < 0) goto out; } - + j++; - + /* close */ if(H5Tclose( member_type_id ) < 0) goto out; if(H5Tclose( nmtype_id ) < 0) goto out; } - + free( member_name ); - + } - + /* get the dataspace handle */ if ((file_space_id = H5Dget_space( did )) < 0) goto out; if ((m_sid = H5Screate_simple(1, &nrecords, NULL)) < 0) goto out; - + /* define a hyperslab in the dataset */ offset[0] = start; count[0] = nrecords; if (H5Sselect_hyperslab( file_space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* write */ if (H5Dwrite( did, write_type_id, m_sid, file_space_id, preserve_id, buf ) < 0) goto out; - + /* close */ if(H5Tclose( write_type_id ) ) goto out; @@ -602,9 +602,9 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, return -1; if(H5Sclose( m_sid ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -617,41 +617,41 @@ out: H5Tclose(tid); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TBwrite_fields_index - * - * Purpose: Writes fields - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 21, 2001 - * - * Comments: Uses memory offsets - * - * Modifications: April 1, 2004 - * the FIELD_SIZES parameter is used to define a memory type ID - * - *------------------------------------------------------------------------- - */ +* Function: H5TBwrite_fields_index +* +* Purpose: Writes fields +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 21, 2001 +* +* Comments: Uses memory offsets +* +* Modifications: April 1, 2004 +* the FIELD_SIZES parameter is used to define a memory type ID +* +*------------------------------------------------------------------------- +*/ herr_t H5TBwrite_fields_index( hid_t loc_id, - const char *dset_name, - hsize_t nfields, - const int *field_index, - hsize_t start, - hsize_t nrecords, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - const void *buf ) + const char *dset_name, + hsize_t nfields, + const int *field_index, + hsize_t start, + hsize_t nrecords, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + const void *buf ) { hid_t did; hid_t tid=-1; @@ -666,50 +666,50 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, hsize_t i, j; hid_t preserve_id; size_t size_native; - + /* create xfer properties to preserve initialized data */ if ((preserve_id = H5Pcreate (H5P_DATASET_XFER)) < 0) return -1; if (H5Pset_preserve (preserve_id, 1) < 0) return -1; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) goto out; - + /* get the datatype */ if ((tid = H5Dget_type( did )) < 0) goto out; - + /* create a write id */ if (( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0) goto out; - + /* iterate tru the members */ for ( i = 0; i < nfields; i++) { - + j = field_index[i]; - + /* get the member name */ member_name = H5Tget_member_name( tid, (unsigned) j ); - + /* get the member type */ if (( member_type_id = H5Tget_member_type( tid, (unsigned) j )) < 0) goto out; - + /* convert to native type */ if ((nmtype_id = H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT)) < 0) goto out; - + size_native = H5Tget_size(nmtype_id); - + if (field_sizes[i]!=size_native) { if (H5Tset_size(nmtype_id, field_sizes[i]) < 0) goto out; } - + /* the field in the file is found by its name */ if ( field_offset ) { @@ -727,27 +727,27 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, goto out; if(H5Tclose( nmtype_id ) < 0) goto out; - + free( member_name ); - + } - + /* get the dataspace handles */ if ((file_space_id = H5Dget_space( did )) < 0) goto out; if ((m_sid = H5Screate_simple(1, &nrecords, NULL)) < 0) goto out; - + /* define a hyperslab in the dataset */ offset[0] = start; count[0] = nrecords; if (H5Sselect_hyperslab( file_space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* write */ if (H5Dwrite( did, write_type_id, m_sid, file_space_id, preserve_id, buf ) < 0) goto out; - + /* close */ if (H5Tclose( write_type_id ) ) goto out; @@ -761,9 +761,9 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, return -1; if (H5Sclose( m_sid ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -780,68 +780,68 @@ out: /*------------------------------------------------------------------------- - * - * Read functions - * - *------------------------------------------------------------------------- - */ +* +* Read functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5TBread_table - * - * Purpose: Reads a table - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 20, 2001 - * - * Comments: - * - * Modifications: April 1, 2004 - * used a memory type ID returned by H5TB_create_type - * - *------------------------------------------------------------------------- - */ +* Function: H5TBread_table +* +* Purpose: Reads a table +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 20, 2001 +* +* Comments: +* +* Modifications: April 1, 2004 +* used a memory type ID returned by H5TB_create_type +* +*------------------------------------------------------------------------- +*/ herr_t H5TBread_table( hid_t loc_id, - const char *dset_name, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - void *dst_buf ) + const char *dset_name, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + void *dst_buf ) { hid_t did; hid_t ftype_id=-1; hid_t mem_type_id=-1; hid_t sid; hsize_t dims[1]; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /* get the dataspace handle */ if ((sid = H5Dget_space( did )) < 0) goto out; - + /* get dimensions */ if (H5Sget_simple_extent_dims( sid, dims, NULL) < 0) goto out; - + /* get the datatypes */ if ((ftype_id=H5Dget_type (did)) < 0) goto out; - + if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,ftype_id)) < 0) goto out; - + /* read */ if (H5Dread( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, dst_buf) < 0) goto out; - + /* close */ if (H5Tclose( ftype_id ) < 0) goto out; @@ -851,9 +851,9 @@ herr_t H5TBread_table( hid_t loc_id, goto out; if (H5Dclose( did ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -867,36 +867,36 @@ out: } /*------------------------------------------------------------------------- - * Function: H5TBread_records - * - * Purpose: Reads records - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 19, 2001 - * - * Comments: - * - * Modifications: April 1, 2004 - * the FIELD_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type - * - *------------------------------------------------------------------------- - */ +* Function: H5TBread_records +* +* Purpose: Reads records +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 19, 2001 +* +* Comments: +* +* Modifications: April 1, 2004 +* the FIELD_SIZES parameter is used to define the memory type ID +* returned by H5TB_create_type +* +*------------------------------------------------------------------------- +*/ herr_t H5TBread_records( hid_t loc_id, - const char *dset_name, - hsize_t start, - hsize_t nrecords, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - void *buf ) + const char *dset_name, + hsize_t start, + hsize_t nrecords, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + void *buf ) { - + hid_t did; hid_t ftype_id; hid_t mem_type_id=-1; @@ -904,22 +904,22 @@ herr_t H5TBread_records( hid_t loc_id, hid_t m_sid=-1; hsize_t nrecords_orig; hsize_t nfields; - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords_orig ) < 0) return -1; - + /* open the dataset */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /* get the datatypes */ if ((ftype_id = H5Dget_type( did )) < 0) goto out; - + if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,ftype_id)) < 0) goto out; - + /* read the records */ if ((H5TB_common_read_records(did, mem_type_id, start, (size_t)nrecords, nrecords_orig, buf)) < 0) goto out; @@ -931,9 +931,9 @@ herr_t H5TBread_records( hid_t loc_id, return -1; if (H5Dclose( did ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY { @@ -944,40 +944,40 @@ out: H5Sclose(sid); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TBread_fields_name - * - * Purpose: Reads fields - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 19, 2001 - * - * Comments: - * - * Modifications: April 1, 2004 - * the FIELD_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type - * - *------------------------------------------------------------------------- - */ +* Function: H5TBread_fields_name +* +* Purpose: Reads fields +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 19, 2001 +* +* Comments: +* +* Modifications: April 1, 2004 +* the FIELD_SIZES parameter is used to define the memory type ID +* returned by H5TB_create_type +* +*------------------------------------------------------------------------- +*/ herr_t H5TBread_fields_name( hid_t loc_id, - const char *dset_name, - const char *field_names, - hsize_t start, - hsize_t nrecords, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - void *buf ) + const char *dset_name, + const char *field_names, + hsize_t start, + hsize_t nrecords, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + void *buf ) { hid_t did; @@ -994,41 +994,41 @@ herr_t H5TBread_fields_name( hid_t loc_id, hsize_t mem_size[1]; size_t size_native; hssize_t i, j; - + /* open the dataset */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) goto out; - + /* get the datatype */ if ((ftype_id = H5Dget_type( did )) < 0) goto out; - + /* get the number of fields */ if (( nfields = H5Tget_nmembers( ftype_id )) < 0) goto out; - + /* create a memory read id */ if (( mem_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0) goto out; - + /* iterate tru the members */ for ( i=0,j=0; i 0 ) { /* get the member type */ if (( mtype_id = H5Tget_member_type( ftype_id, (unsigned) i )) < 0) goto out; - + /* convert to native type */ if ((nmtype_id=H5Tget_native_type(mtype_id,H5T_DIR_DEFAULT)) < 0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (field_sizes[j]!=size_native) { if (H5Tset_size(nmtype_id, field_sizes[j]) < 0) @@ -1045,7 +1045,7 @@ herr_t H5TBread_fields_name( hid_t loc_id, if(H5Tinsert( mem_type_id, member_name, (size_t)0, nmtype_id ) < 0) goto out; } - + /* close */ if(H5Tclose( mtype_id ) < 0) goto out; @@ -1055,26 +1055,26 @@ herr_t H5TBread_fields_name( hid_t loc_id, } free( member_name ); } - + /* get the dataspace handle */ if ((sid = H5Dget_space( did )) < 0) goto out; - + /* define a hyperslab in the dataset */ offset[0] = start; count[0] = nrecords; if (H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((m_sid = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; - + /* read */ if (H5Dread( did, mem_type_id, m_sid, sid, H5P_DEFAULT, buf ) < 0) goto out; - + /* close */ if (H5Tclose( mem_type_id ) ) goto out; @@ -1086,9 +1086,9 @@ herr_t H5TBread_fields_name( hid_t loc_id, goto out; if (H5Dclose( did ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -1100,43 +1100,43 @@ out: H5Sclose(sid); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TBread_fields_index - * - * Purpose: Reads fields - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 19, 2001 - * - * Comments: - * - * Modifications: April 1, 2004 - * the FIELD_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type - * - *------------------------------------------------------------------------- - */ +* Function: H5TBread_fields_index +* +* Purpose: Reads fields +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 19, 2001 +* +* Comments: +* +* Modifications: April 1, 2004 +* the FIELD_SIZES parameter is used to define the memory type ID +* returned by H5TB_create_type +* +*------------------------------------------------------------------------- +*/ herr_t H5TBread_fields_index( hid_t loc_id, - const char *dset_name, - hsize_t nfields, - const int *field_index, - hsize_t start, - hsize_t nrecords, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - void *buf ) + const char *dset_name, + hsize_t nfields, + const int *field_index, + hsize_t start, + hsize_t nrecords, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + void *buf ) { - + hid_t did; hid_t tid=-1; hid_t read_type_id=-1; @@ -1150,47 +1150,47 @@ herr_t H5TBread_fields_index( hid_t loc_id, hsize_t mem_size[1]; size_t size_native; hsize_t i, j; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) goto out; - + /* get the datatype */ if ((tid = H5Dget_type( did )) < 0) goto out; - + /* create a read id */ if (( read_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0) goto out; - + /* iterate tru the members */ for ( i = 0; i < nfields; i++) { j = field_index[i]; - + /* get the member name */ member_name = H5Tget_member_name( tid, (unsigned) j ); - + /* get the member type */ if (( member_type_id = H5Tget_member_type( tid, (unsigned) j )) < 0) goto out; - + /* get the member size */ if (H5Tget_size( member_type_id ) == 0 ) goto out; - + /* convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT)) < 0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (field_sizes[i]!=size_native) { if (H5Tset_size(nmtype_id, field_sizes[i]) < 0) goto out; } - + /* the field in the file is found by its name */ if (field_offset ) { @@ -1202,35 +1202,35 @@ herr_t H5TBread_fields_index( hid_t loc_id, if(H5Tinsert( read_type_id, member_name, (size_t)0, nmtype_id ) < 0) goto out; } - + /* close the member type */ if (H5Tclose( member_type_id ) < 0) goto out; if (H5Tclose( nmtype_id ) < 0) goto out; - + free( member_name ); } - + /* get the dataspace handle */ if ((sid = H5Dget_space( did )) < 0) goto out; - + /* define a hyperslab in the dataset */ offset[0] = start; count[0] = nrecords; if (H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((m_sid = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; - + /* read */ if (H5Dread( did, read_type_id, m_sid, sid, H5P_DEFAULT, buf ) < 0) goto out; - + /* close */ if (H5Sclose( sid ) < 0) goto out; @@ -1242,9 +1242,9 @@ herr_t H5TBread_fields_index( hid_t loc_id, return -1; if (H5Dclose( did ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -1256,40 +1256,40 @@ out: H5Sclose(sid); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * - * Manipulation functions - * - *------------------------------------------------------------------------- - */ +* +* Manipulation functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5TBdelete_record - * - * Purpose: Delete records from middle of table ("pulling up" all the records after it) - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 26, 2001 - * - * Modifications: April 29, 2003 - * - * - *------------------------------------------------------------------------- - */ +* Function: H5TBdelete_record +* +* Purpose: Delete records from middle of table ("pulling up" all the records after it) +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 26, 2001 +* +* Modifications: April 29, 2003 +* +* +*------------------------------------------------------------------------- +*/ herr_t H5TBdelete_record( hid_t loc_id, - const char *dset_name, - hsize_t start, - hsize_t nrecords ) + const char *dset_name, + hsize_t start, + hsize_t nrecords ) { - + hsize_t nfields; hsize_t ntotal_records; hsize_t read_start; @@ -1306,24 +1306,24 @@ herr_t H5TBdelete_record( hid_t loc_id, size_t *src_offset; size_t *src_sizes; hsize_t dims[1]; - + /*------------------------------------------------------------------------- * first we get information about type size and offsets on disk *------------------------------------------------------------------------- */ - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &ntotal_records ) < 0) return -1; - + src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)); src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t)); - + if (src_offset == NULL ) return -1; if (src_sizes == NULL ) return -1; - + /* get field info */ if (H5TBget_field_info( loc_id, dset_name, NULL, src_sizes, src_offset, &src_size ) < 0) return -1; @@ -1331,53 +1331,53 @@ herr_t H5TBdelete_record( hid_t loc_id, /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /*------------------------------------------------------------------------- * read the records after the deleted one(s) *------------------------------------------------------------------------- */ - + read_start = start + nrecords; read_nrecords = ntotal_records - read_start; if ( read_nrecords ) { tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, src_size ); - + if (tmp_buf == NULL ) return -1; - + /* read the records after the deleted one(s) */ if (H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0) return -1; - + /*------------------------------------------------------------------------- * write the records in another position *------------------------------------------------------------------------- */ - + /* get the datatype */ if ((tid = H5Dget_type( did )) < 0) goto out; - + /* get the dataspace handle */ if ((sid = H5Dget_space( did )) < 0) goto out; - + /* define a hyperslab in the dataset of the size of the records */ offset[0] = start; count[0] = read_nrecords; if (H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((m_sid = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; - + if (H5Dwrite( did, tid, m_sid, sid, H5P_DEFAULT, tmp_buf ) < 0) goto out; - + /* close */ if (H5Sclose( m_sid ) < 0) goto out; @@ -1385,10 +1385,10 @@ herr_t H5TBdelete_record( hid_t loc_id, goto out; if (H5Tclose( tid ) < 0) goto out; - + } /* read_nrecords */ - - + + /*------------------------------------------------------------------------- * change the dataset dimension *------------------------------------------------------------------------- @@ -1396,20 +1396,20 @@ herr_t H5TBdelete_record( hid_t loc_id, dims[0] = ntotal_records - nrecords; if (H5Dset_extent( did, dims ) < 0) goto out; - + /* close dataset */ if (H5Dclose( did ) < 0) return -1; - + if (tmp_buf !=NULL) free( tmp_buf ); free( src_offset ); free( src_sizes ); - - + + return 0; - /* error zone */ + /* error zone */ out: if (tmp_buf !=NULL ) @@ -1421,41 +1421,41 @@ out: H5Sclose(sid); } H5E_END_TRY; return -1; - - + + } /*------------------------------------------------------------------------- - * Function: H5TBinsert_record - * - * Purpose: Inserts records into middle of table ("pushing down" all the records after it) - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 26, 2001 - * - * Comments: Uses memory offsets - * - * Modifications: April 1, 2004 - * the FIELD_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type - * - *------------------------------------------------------------------------- - */ +* Function: H5TBinsert_record +* +* Purpose: Inserts records into middle of table ("pushing down" all the records after it) +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 26, 2001 +* +* Comments: Uses memory offsets +* +* Modifications: April 1, 2004 +* the FIELD_SIZES parameter is used to define the memory type ID +* returned by H5TB_create_type +* +*------------------------------------------------------------------------- +*/ herr_t H5TBinsert_record( hid_t loc_id, - const char *dset_name, - hsize_t start, - hsize_t nrecords, - size_t type_size, - const size_t *field_offset, - const size_t *field_sizes, - void *buf ) + const char *dset_name, + hsize_t start, + hsize_t nrecords, + size_t type_size, + const size_t *field_offset, + const size_t *field_sizes, + void *buf ) { - + hsize_t nfields; hsize_t ntotal_records; hsize_t read_nrecords; @@ -1469,93 +1469,93 @@ herr_t H5TBinsert_record( hid_t loc_id, hsize_t dims[1]; hsize_t mem_dims[1]; unsigned char *tmp_buf; - + /*------------------------------------------------------------------------- * read the records after the inserted one(s) *------------------------------------------------------------------------- */ - + /* get the dimensions */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &ntotal_records ) < 0) return -1; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) goto out; - + /* get the datatype */ if ((tid = H5Dget_type( did )) < 0) goto out; - + /* create the memory data type. */ if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid)) < 0) goto out; - + read_nrecords = ntotal_records - start; tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, type_size); - + /* read the records after the inserted one(s) */ if (H5TBread_records( loc_id, dset_name, start, read_nrecords, type_size, field_offset, field_sizes, tmp_buf ) < 0) return -1; - + /* extend the dataset */ dims[0] = ntotal_records + nrecords; - + if (H5Dset_extent(did, dims) < 0) goto out; - + /*------------------------------------------------------------------------- * write the inserted records *------------------------------------------------------------------------- */ - + /* create a simple memory data space */ mem_dims[0] = nrecords; if ((m_sid = H5Screate_simple(1, mem_dims, NULL)) < 0) return -1; - + /* get the file data space */ if ((sid = H5Dget_space( did )) < 0) return -1; - + /* define a hyperslab in the dataset to write the new data */ offset[0] = start; count[0] = nrecords; if (H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + if (H5Dwrite( did, mem_type_id, m_sid, sid, H5P_DEFAULT, buf ) < 0) goto out; - + /* terminate access to the dataspace */ if (H5Sclose( m_sid ) < 0) goto out; if (H5Sclose( sid ) < 0) goto out; - + /*------------------------------------------------------------------------- * write the "pushed down" records *------------------------------------------------------------------------- */ - + /* create a simple memory data space */ mem_dims[0]=read_nrecords; if ((m_sid = H5Screate_simple( 1, mem_dims, NULL )) < 0) return -1; - + /* get the file data space */ if ((sid = H5Dget_space( did )) < 0) return -1; - + /* define a hyperslab in the dataset to write the new data */ offset[0] = start + nrecords; count[0] = read_nrecords; if (H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + if (H5Dwrite( did, mem_type_id, m_sid, sid, H5P_DEFAULT, tmp_buf ) < 0) goto out; - + /* close */ if (H5Sclose( m_sid ) < 0) goto out; @@ -1567,11 +1567,11 @@ herr_t H5TBinsert_record( hid_t loc_id, return -1; if (H5Dclose( did ) < 0) return -1; - + free( tmp_buf ); - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -1586,30 +1586,30 @@ out: } /*------------------------------------------------------------------------- - * Function: H5TBadd_records_from - * - * Purpose: Add records from first table to second table - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 5, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5TBadd_records_from +* +* Purpose: Add records from first table to second table +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: December 5, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5TBadd_records_from( hid_t loc_id, - const char *dset_name1, - hsize_t start1, - hsize_t nrecords, - const char *dset_name2, - hsize_t start2 ) + const char *dset_name1, + hsize_t start1, + hsize_t nrecords, + const char *dset_name2, + hsize_t start2 ) { hid_t did_1; hid_t tid_1; @@ -1625,75 +1625,75 @@ herr_t H5TBadd_records_from( hid_t loc_id, size_t src_size; size_t *src_offset; size_t *src_sizes; - + /*------------------------------------------------------------------------- * first we get information about type size and offsets on disk *------------------------------------------------------------------------- */ - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name1, &nfields, &ntotal_records ) < 0) return -1; - + src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)); src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t)); - + if (src_offset == NULL ) return -1; - + /* get field info */ if (H5TBget_field_info( loc_id, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0) return -1; - + /*------------------------------------------------------------------------- * Get information about the first table and read it *------------------------------------------------------------------------- */ - + /* open the 1st dataset. */ if ((did_1 = H5Dopen2(loc_id, dset_name1, H5P_DEFAULT)) < 0) return -1; - + /* get the datatype */ if ((tid_1 = H5Dget_type( did_1 )) < 0) goto out; - + /* get the dataspace handle */ if ((sid_1 = H5Dget_space( did_1 )) < 0) goto out; - + /* get the size of the datatype */ if (( type_size1 = H5Tget_size( tid_1 )) == 0 ) goto out; - + tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size1 ); - + /* define a hyperslab in the dataset of the size of the records */ offset[0] = start1; count[0] = nrecords; if (H5Sselect_hyperslab( sid_1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((msid_1 = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; - + if (H5Dread( did_1, tid_1, msid_1, sid_1, H5P_DEFAULT, tmp_buf ) < 0) goto out; - + /*------------------------------------------------------------------------- * add to the second table *------------------------------------------------------------------------- */ if (H5TBinsert_record(loc_id,dset_name2,start2,nrecords,src_size,src_offset,src_sizes,tmp_buf ) < 0) goto out; - + /*------------------------------------------------------------------------- * close resources for table 1 *------------------------------------------------------------------------- */ - + if (H5Sclose( msid_1 ) < 0) goto out; if (H5Sclose( sid_1 ) < 0) @@ -1702,13 +1702,13 @@ herr_t H5TBadd_records_from( hid_t loc_id, return -1; if (H5Dclose( did_1 ) < 0) return -1; - + free( tmp_buf ); free( src_offset ); free( src_sizes ); - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -1719,34 +1719,34 @@ out: H5Tclose(tid_1); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TBcombine_tables - * - * Purpose: Combine records from two tables into a third - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 10, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5TBcombine_tables +* +* Purpose: Combine records from two tables into a third +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: December 10, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5TBcombine_tables( hid_t loc_id1, - const char *dset_name1, - hid_t loc_id2, - const char *dset_name2, - const char *dset_name3 ) + const char *dset_name1, + hid_t loc_id2, + const char *dset_name2, + const char *dset_name3 ) { - + /* identifiers for the 1st dataset. */ hid_t did_1=-1; hid_t tid_1=-1; @@ -1784,178 +1784,178 @@ herr_t H5TBcombine_tables( hid_t loc_id1, size_t *src_offset; size_t *src_sizes; int has_fill=0; - + /*------------------------------------------------------------------------- * first we get information about type size and offsets on disk *------------------------------------------------------------------------- */ - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0) return -1; - + src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)); src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t)); - + if (src_offset == NULL ) return -1; - + /* get field info */ if (H5TBget_field_info( loc_id1, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0) return -1; - + /*------------------------------------------------------------------------- * get information about the first table *------------------------------------------------------------------------- */ - + /* open the 1st dataset. */ if ((did_1 = H5Dopen2(loc_id1, dset_name1, H5P_DEFAULT)) < 0) goto out; - + /* get the datatype */ if ((tid_1 = H5Dget_type( did_1 )) < 0) goto out; - + /* get the dataspace handle */ if ((sid_1 = H5Dget_space( did_1 )) < 0) goto out; - + /* get creation properties list */ if ((pid_1 = H5Dget_create_plist( did_1 )) < 0) goto out; - + /* get the dimensions */ if (H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0) return -1; - + /*------------------------------------------------------------------------- * make the merged table with no data originally *------------------------------------------------------------------------- */ - + /* clone the property list */ if ((pid_3 = H5Pcopy(pid_1)) < 0) goto out; - + /* clone the type id */ if ((tid_3 = H5Tcopy(tid_1)) < 0) goto out; - + /*------------------------------------------------------------------------- * here we do not clone the file space from the 1st dataset, because we want to create * an empty table. Instead we create a new dataspace with zero records and expandable. *------------------------------------------------------------------------- */ dims[0] = 0; - + /* create a simple data space with unlimited size */ if ((sid_3 = H5Screate_simple(1, dims, maxdims)) < 0) return -1; - + /* create the dataset */ if ((did_3 = H5Dcreate2(loc_id1, dset_name3, tid_3, sid_3, H5P_DEFAULT, pid_3, H5P_DEFAULT)) < 0) goto out; - + /*------------------------------------------------------------------------- * attach the conforming table attributes *------------------------------------------------------------------------- */ if (H5TB_attach_attributes("Merge table", loc_id1, dset_name3, nfields, tid_3) < 0) goto out; - + /*------------------------------------------------------------------------- * get attributes *------------------------------------------------------------------------- */ - + type_size = H5Tget_size(tid_3); - + /* alloc fill value attribute buffer */ tmp_fill_buf = (unsigned char *)malloc(type_size); - + /* get the fill value attributes */ has_fill = H5TBAget_fill(loc_id1, dset_name1, did_1, tmp_fill_buf); - + /*------------------------------------------------------------------------- * attach the fill attributes from previous table *------------------------------------------------------------------------- */ if (has_fill == 1 ) { - + if (( sid = H5Screate(H5S_SCALAR)) < 0) goto out; - + for ( i = 0; i < nfields; i++) { - + /* get the member type */ if (( member_type_id = H5Tget_member_type( tid_3, (unsigned) i )) < 0) goto out; - + /* get the member offset */ member_offset = H5Tget_member_offset(tid_3, (unsigned)i); - + strcpy(attr_name, "FIELD_"); sprintf(aux, "%d", (int)i); strcat(attr_name, aux); sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - + if ((attr_id = H5Acreate2(did_3, attr_name, member_type_id, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - + if (H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0) goto out; - + if (H5Aclose(attr_id) < 0) goto out; - + if (H5Tclose(member_type_id) < 0) goto out; } - + /* close data space. */ if (H5Sclose( sid ) < 0) goto out; } - + /*------------------------------------------------------------------------- * read data from 1st table *------------------------------------------------------------------------- */ - + tmp_buf = (unsigned char *)calloc((size_t) nrecords, type_size ); - + /* define a hyperslab in the dataset of the size of the records */ offset[0] = 0; count[0] = nrecords; if (H5Sselect_hyperslab( sid_1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((m_sid = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; - + if (H5Dread( did_1, tid_1, m_sid, sid_1, H5P_DEFAULT, tmp_buf ) < 0) goto out; - + /*------------------------------------------------------------------------- * save data from 1st table into new table *------------------------------------------------------------------------- */ - + /* append the records to the new table */ if (H5TBappend_records( loc_id1, dset_name3, nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0) goto out; - + /*------------------------------------------------------------------------- * release resources from 1st table *------------------------------------------------------------------------- */ - + if (H5Sclose( m_sid ) < 0) goto out; if(H5Sclose( sid_1 ) < 0) @@ -1966,70 +1966,70 @@ herr_t H5TBcombine_tables( hid_t loc_id1, goto out; if(H5Dclose( did_1 ) < 0) goto out; - + /* Release resources. */ free( tmp_buf ); - + /*------------------------------------------------------------------------- * get information about the 2nd table *------------------------------------------------------------------------- */ - + /* open the dataset. */ if ((did_2 = H5Dopen2(loc_id2, dset_name2, H5P_DEFAULT)) < 0) goto out; - + /* get the datatype */ if ((tid_2 = H5Dget_type( did_2 )) < 0) goto out; - + /* get the dataspace handle */ if ((sid_2 = H5Dget_space( did_2 )) < 0) goto out; - + /* get the property list handle */ if ((pid_2 = H5Dget_create_plist( did_2 )) < 0) goto out; - + /* get the dimensions */ if (H5TBget_table_info ( loc_id2, dset_name2, &nfields, &nrecords ) < 0) return -1; - + /*------------------------------------------------------------------------- * read data from 2nd table *------------------------------------------------------------------------- */ - + tmp_buf = (unsigned char *)calloc((size_t) nrecords, type_size ); - + /* define a hyperslab in the dataset of the size of the records */ offset[0] = 0; count[0] = nrecords; if (H5Sselect_hyperslab( sid_2, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((m_sid = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; - + if (H5Dread( did_2, tid_2, m_sid, sid_2, H5P_DEFAULT, tmp_buf ) < 0) goto out; - + /*------------------------------------------------------------------------- * save data from 2nd table into new table *------------------------------------------------------------------------- */ - + /* append the records to the new table */ if (H5TBappend_records( loc_id1, dset_name3, nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0) goto out; - + /*------------------------------------------------------------------------- * release resources from 2nd table *------------------------------------------------------------------------- */ - + if (H5Sclose( m_sid ) < 0) goto out; if (H5Sclose( sid_2 ) < 0) @@ -2040,12 +2040,12 @@ herr_t H5TBcombine_tables( hid_t loc_id1, goto out; if (H5Dclose( did_2 ) < 0) return -1; - + /*------------------------------------------------------------------------- * release resources from 3rd table *------------------------------------------------------------------------- */ - + if (H5Sclose( sid_3 ) < 0) return -1; if (H5Tclose( tid_3 ) < 0) @@ -2054,16 +2054,16 @@ herr_t H5TBcombine_tables( hid_t loc_id1, return -1; if (H5Dclose( did_3 ) < 0) return -1; - + /* Release resources. */ free( tmp_buf ); free( tmp_fill_buf ); free( src_offset ); free( src_sizes ); - + return 0; - - /* error zone */ + + /* error zone */ out: H5E_BEGIN_TRY { @@ -2081,34 +2081,34 @@ out: H5Pclose(pid_3); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TBinsert_field - * - * Purpose: Inserts a field - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: January 30, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5TBinsert_field +* +* Purpose: Inserts a field +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: January 30, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5TBinsert_field( hid_t loc_id, - const char *dset_name, - const char *field_name, - hid_t field_type, - hsize_t position, - const void *fill_data, - const void *buf ) + const char *dset_name, + const char *field_name, + hid_t field_type, + hsize_t position, + const void *fill_data, + const void *buf ) { /* identifiers for the 1st, original dataset */ hid_t did_1; @@ -2148,214 +2148,214 @@ herr_t H5TBinsert_field( hid_t loc_id, unsigned char *tmp_buf; unsigned char *tmp_fill_buf; hsize_t i; - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0) return -1; - + /*------------------------------------------------------------------------- * get information about the old data type *------------------------------------------------------------------------- */ - + /* open the dataset. */ if ((did_1 = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /* get creation properties list */ if ((pid_1 = H5Dget_create_plist( did_1 )) < 0) goto out; - + /* get the datatype */ if ((tid_1 = H5Dget_type( did_1 )) < 0) goto out; - + /* get the size of the datatype */ if (( total_size = H5Tget_size( tid_1 )) == 0 ) goto out; - + /* get the dataspace handle */ if ((sid_1 = H5Dget_space( did_1 )) < 0) goto out; - + /* get dimension */ if (H5Sget_simple_extent_dims( sid_1, dims, NULL) < 0) goto out; - + /*------------------------------------------------------------------------- * get attributes *------------------------------------------------------------------------- */ - + /* get the table title */ if ((H5TBAget_title( did_1, table_title )) < 0) goto out; - + /* alloc fill value attribute buffer */ tmp_fill_buf = (unsigned char *)malloc(total_size ); - + /* get the fill value attributes */ if ((H5TBAget_fill( loc_id, dset_name, did_1, tmp_fill_buf )) < 0) goto out; - + /*------------------------------------------------------------------------- * create a new data type *------------------------------------------------------------------------- */ - + /* get the new member size */ member_size = H5Tget_size( field_type ); - + /* create the data type. */ if (( tid_2 = H5Tcreate (H5T_COMPOUND,(size_t)(total_size + member_size) )) < 0) goto out; - + curr_offset = 0; inserted = 0; - + /* insert the old fields, counting with the new one */ for ( i = 0; i < nfields + 1; i++) { idx = i; if (inserted ) idx = i - 1; - + if (i == position ) { /* get the new member size */ new_member_size = H5Tget_size( field_type ); - + /* insert the new field type */ if (H5Tinsert( tid_2, field_name, curr_offset, field_type ) < 0) goto out; - + curr_offset += new_member_size; - + inserted = 1; - + continue; } - + /* get the member name */ member_name = H5Tget_member_name( tid_1, (unsigned)idx ); - + /* get the member type */ if (( member_type_id = H5Tget_member_type( tid_1,(unsigned)idx )) < 0) goto out; - + /* get the member size */ member_size = H5Tget_size( member_type_id ); - + /* insert it into the new type */ if (H5Tinsert( tid_2, member_name, curr_offset, member_type_id ) < 0) goto out; - + curr_offset += member_size; - + free( member_name ); - + /* close the member type */ if(H5Tclose( member_type_id ) < 0) goto out; } /* i */ - + /*------------------------------------------------------------------------- * create a new temporary dataset *------------------------------------------------------------------------- */ - + /* retrieve the size of chunk */ if (H5Pget_chunk(pid_1, 1, dims_chunk) < 0) goto out; - + /* create a new simple data space with unlimited size, using the dimension */ if ((sid_2 = H5Screate_simple( 1, dims, maxdims)) < 0) return -1; - + /* modify dataset creation properties, i.e. enable chunking */ pid_2 = H5Pcreate(H5P_DATASET_CREATE); if (H5Pset_chunk(pid_2, 1, dims_chunk) < 0) return -1; - + /* create the dataset. */ if ((did_2 = H5Dcreate2(loc_id, "new", tid_2, sid_2, H5P_DEFAULT, pid_2, H5P_DEFAULT)) < 0) goto out; - + /*------------------------------------------------------------------------- * read data from 1st table *------------------------------------------------------------------------- */ - + tmp_buf = (unsigned char *)calloc((size_t)nrecords, (size_t)total_size); - + /* define a hyperslab in the dataset of the size of the records */ offset[0] = 0; count[0] = nrecords; if (H5Sselect_hyperslab(sid_1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((msid_1 = H5Screate_simple(1, mem_size, NULL)) < 0) goto out; - + if (H5Dread(did_1, tid_1, msid_1, H5S_ALL, H5P_DEFAULT, tmp_buf) < 0) goto out; - + /*------------------------------------------------------------------------- * save data from 1st table into new table, using the 1st type id *------------------------------------------------------------------------- */ - + /* write */ if (H5Dwrite( did_2, tid_1, msid_1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0) goto out; - + /*------------------------------------------------------------------------- * save the function supplied data of the new field *------------------------------------------------------------------------- */ - + /* create a write id */ if (( write_type_id = H5Tcreate( H5T_COMPOUND, (size_t)new_member_size )) < 0) goto out; - + /* the field in the file is found by its name */ if (H5Tinsert( write_type_id, field_name, (size_t)0, field_type ) < 0) goto out; - + /* create xfer properties to preserve initialized data */ if ((preserve_id = H5Pcreate (H5P_DATASET_XFER)) < 0) goto out; if (H5Pset_preserve (preserve_id, 1) < 0) goto out; - + /* only write if there is something to write */ if ( buf ) { /* create a memory dataspace handle */ if ((msid_2 = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; - + /* write */ if (H5Dwrite( did_2, write_type_id, msid_2, sid_2, preserve_id, buf ) < 0) goto out; - + /* terminate access to the memory dataspace */ if (H5Sclose( msid_2 ) < 0) goto out; } - + /* end access to the property list */ if (H5Pclose( preserve_id ) < 0) goto out; - + /*------------------------------------------------------------------------- * release resources from 1st table *------------------------------------------------------------------------- */ - + if (H5Sclose( msid_1 ) < 0) goto out; if (H5Tclose( tid_1 ) < 0) @@ -2366,13 +2366,13 @@ herr_t H5TBinsert_field( hid_t loc_id, goto out; if (H5Dclose( did_1 ) < 0) goto out; - - + + /*------------------------------------------------------------------------- * release resources from 2nd table *------------------------------------------------------------------------- */ - + if (H5Sclose( sid_2 ) < 0) goto out; if (H5Tclose( tid_2 ) < 0) @@ -2380,112 +2380,112 @@ herr_t H5TBinsert_field( hid_t loc_id, if (H5Pclose( pid_2 ) < 0) goto out; if (H5Dclose( did_2 ) < 0) - goto out; - + goto out; + /*------------------------------------------------------------------------- * delete 1st table *------------------------------------------------------------------------- */ if (H5Ldelete( loc_id, dset_name, H5P_DEFAULT ) < 0) return -1; - + /*------------------------------------------------------------------------- * rename 2nd table *------------------------------------------------------------------------- */ - + if (H5Lmove( loc_id, "new", H5L_SAME_LOC, dset_name, H5P_DEFAULT, H5P_DEFAULT ) < 0) return -1; - + /*------------------------------------------------------------------------- * attach the conforming table attributes *------------------------------------------------------------------------- */ - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0) return -1; - + /* open the dataset. */ if ((did_1 = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /* get the datatype */ if ((tid_1 = H5Dget_type( did_1 )) < 0) goto out; - + /* set the attributes */ if (H5TB_attach_attributes( table_title, loc_id, dset_name,(hsize_t) nfields, tid_1 ) < 0) return -1; - + /*------------------------------------------------------------------------- * attach the fill attributes from previous table *------------------------------------------------------------------------- */ - + if (( sid_1 = H5Screate(H5S_SCALAR)) < 0) goto out; - + for ( i = 0; i < nfields-1; i++) { /* get the member type */ if(( member_type_id = H5Tget_member_type( tid_1, (unsigned) i )) < 0) goto out; - + /* get the member offset */ member_offset = H5Tget_member_offset(tid_1, (unsigned)i); - + strcpy(attr_name, "FIELD_"); sprintf(aux, "%d", (int)i); strcat(attr_name, aux); sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - + if ((attr_id = H5Acreate2(did_1, attr_name, member_type_id, sid_1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - + if (H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0) goto out; - + if (H5Aclose(attr_id) < 0) goto out; - + /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; } - + /*------------------------------------------------------------------------- * attach the fill attribute from the new field, if present *------------------------------------------------------------------------- */ if (fill_data) { - + strcpy(attr_name, "FIELD_"); sprintf(aux, "%d",(int)(nfields - 1)); strcat(attr_name, aux); sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - + /* get the member type */ if ((member_type_id = H5Tget_member_type(tid_1, (unsigned)nfields - 1)) < 0) goto out; - + if ((attr_id = H5Acreate2(did_1, attr_name, member_type_id, sid_1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - + if (H5Awrite(attr_id, member_type_id, fill_data) < 0) goto out; - + if (H5Aclose(attr_id) < 0) goto out; - + if (H5Tclose(member_type_id) < 0) goto out; - + } - + /* close */ if (H5Sclose( sid_1 ) < 0) goto out; @@ -2493,13 +2493,13 @@ herr_t H5TBinsert_field( hid_t loc_id, goto out; if (H5Dclose( did_1 ) < 0) goto out; - + /* release resources. */ free ( tmp_buf ); free ( tmp_fill_buf ); - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -2512,33 +2512,33 @@ out: H5Sclose(sid_2); H5Tclose(tid_2); H5Pclose(pid_2); - + } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TBdelete_field - * - * Purpose: Deletes a field - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: January 30, 2002 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5TBdelete_field +* +* Purpose: Deletes a field +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: January 30, 2002 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5TBdelete_field( hid_t loc_id, - const char *dset_name, - const char *field_name ) + const char *dset_name, + const char *field_name ) { /* identifiers for the 1st original dataset */ hid_t did_1; @@ -2574,179 +2574,179 @@ herr_t H5TBdelete_field( hid_t loc_id, hid_t attr_id; hsize_t i; int has_fill=0; - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0) return -1; - + /*------------------------------------------------------------------------- * get information about the old data type *------------------------------------------------------------------------- */ - + /* open the dataset. */ if ((did_1 = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /* get creation properties list */ if ((pid_1 = H5Dget_create_plist( did_1 )) < 0) goto out; - + /* get the datatype */ if ((tid_1 = H5Dget_type( did_1 )) < 0) goto out; - + /* get the size of the datatype */ type_size1 = H5Tget_size( tid_1 ); - + /* get the dataspace handle */ if ((sid_1 = H5Dget_space( did_1 )) < 0) goto out; - + /* get dimension */ if (H5Sget_simple_extent_dims( sid_1, dims, NULL) < 0) goto out; - + /*------------------------------------------------------------------------- * create a new data type; first we find the size of the datatype to delete *------------------------------------------------------------------------- */ - + /* check out the field */ for ( i = 0; i < nfields; i++) { /* get the member name */ member_name = H5Tget_member_name( tid_1,(unsigned) i ); - + /* we want to find the field to delete */ if (H5TB_find_field( member_name, field_name ) > 0 ) { /* get the member type */ if (( member_type_id = H5Tget_member_type( tid_1,(unsigned) i )) < 0) goto out; - + /* get the member size */ delete_member_size = H5Tget_size( member_type_id ); - + /* close the member type */ if (H5Tclose( member_type_id ) < 0) goto out; - + free( member_name ); - + break; - + } - + free( member_name ); - + } /* i */ - + /* no field to delete was found */ if (delete_member_size == 0 ) goto out; - + /*------------------------------------------------------------------------- * create a new data type; we now insert all the fields into the new type *------------------------------------------------------------------------- */ - + type_size2 = type_size1 - delete_member_size; - + /* create the data type. */ if (( tid_2 = H5Tcreate (H5T_COMPOUND, type_size2 )) < 0) goto out; - + curr_offset = 0; - + /* alloc fill value attribute buffer */ tmp_fill_buf = (unsigned char *)malloc((size_t) type_size2 ); - + /*------------------------------------------------------------------------- * get attributes from previous table in the process *------------------------------------------------------------------------- */ - + /* get the table title */ if ((H5TBAget_title( did_1, table_title )) < 0) goto out; - + /* insert the old fields except the one to delete */ for ( i = 0; i < nfields; i++) { /* get the member name */ member_name = H5Tget_member_name( tid_1, (unsigned) i ); - + /* we want to skip the field to delete */ if (H5TB_find_field( member_name, field_name ) > 0 ) { free( member_name ); continue; } - + /* get the member type */ if (( member_type_id = H5Tget_member_type( tid_1, (unsigned)i )) < 0) goto out; - + /* get the member size */ member_size = H5Tget_size( member_type_id ); - + /* insert it into the new type */ if (H5Tinsert( tid_2, member_name, curr_offset, member_type_id ) < 0) goto out; - + /*------------------------------------------------------------------------- * get the fill value information *------------------------------------------------------------------------- */ - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int)i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_FILL" ); strcat( attr_name, aux ); - + /* check if we have the _FILL attribute */ has_fill = H5LT_find_attribute( did_1, attr_name ); - + /* get it */ if (has_fill == 1 ) { if(H5LT_get_attribute_disk( did_1, attr_name, tmp_fill_buf+curr_offset ) < 0) goto out; } - + curr_offset += member_size; - + free(member_name); - + /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; } /* i */ - + /*------------------------------------------------------------------------- * create a new temporary dataset *------------------------------------------------------------------------- */ - + /* retrieve the size of chunk */ if (H5Pget_chunk(pid_1, 1, dims_chunk) < 0) goto out; - + /* create a new simple data space with unlimited size, using the dimension */ if ((sid_2 = H5Screate_simple(1, dims, maxdims)) < 0) return -1; - + /* modify dataset creation properties, i.e. enable chunking */ pid_2 = H5Pcreate(H5P_DATASET_CREATE); if (H5Pset_chunk(pid_2, 1, dims_chunk) < 0) return -1; - + /* create the dataset. */ if ((did_2 = H5Dcreate2(loc_id, "new", tid_2, sid_2, H5P_DEFAULT, pid_2, H5P_DEFAULT)) < 0) goto out; - + /*------------------------------------------------------------------------- * we have to read field by field of the old dataset and save it into the new one *------------------------------------------------------------------------- @@ -2755,80 +2755,80 @@ herr_t H5TBdelete_field( hid_t loc_id, { /* get the member name */ member_name = H5Tget_member_name(tid_1, (unsigned)i); - + /* skip the field to delete */ if (H5TB_find_field(member_name, field_name) > 0) { free(member_name); continue; } - + /* get the member type */ if ((member_type_id = H5Tget_member_type(tid_1, (unsigned)i)) < 0) goto out; - + /* get the member size */ member_size = H5Tget_size(member_type_id); - + /* create a read id */ if ((read_type_id = H5Tcreate(H5T_COMPOUND, member_size)) < 0) goto out; - + /* insert it into the new type */ if (H5Tinsert( read_type_id, member_name, (size_t)0, member_type_id ) < 0) goto out; - + tmp_buf = (unsigned char *)calloc((size_t) nrecords, member_size ); - + /* read */ if (H5Dread( did_1, read_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0) goto out; - + /* create a write id */ if (( write_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0) goto out; - + /* the field in the file is found by its name */ if (H5Tinsert( write_type_id, member_name, (size_t)0, member_type_id ) < 0) goto out; - + /* create xfer properties to preserve initialized data */ if ((preserve_id = H5Pcreate (H5P_DATASET_XFER)) < 0) goto out; if (H5Pset_preserve (preserve_id, 1) < 0) goto out; - + /* write */ if(H5Dwrite( did_2, write_type_id, H5S_ALL, H5S_ALL, preserve_id, tmp_buf ) < 0) goto out; - + /* end access to the property list */ if (H5Pclose( preserve_id ) < 0) goto out; - + /* close the member type */ if (H5Tclose( member_type_id ) < 0) goto out; - + /* close the read type */ if (H5Tclose( read_type_id ) < 0) goto out; - + /* close the write type */ if (H5Tclose( write_type_id ) < 0) goto out; - + /* release resources. */ free( member_name ); free ( tmp_buf ); - + } /* i */ - + /*------------------------------------------------------------------------- * release resources from 1st table *------------------------------------------------------------------------- */ - + if (H5Tclose( tid_1 ) < 0) goto out; if (H5Pclose( pid_1 ) < 0) @@ -2837,13 +2837,13 @@ herr_t H5TBdelete_field( hid_t loc_id, goto out; if (H5Dclose( did_1 ) < 0) goto out; - - + + /*------------------------------------------------------------------------- * release resources from 2nd table *------------------------------------------------------------------------- */ - + if (H5Sclose( sid_2 ) < 0) goto out; if (H5Tclose( tid_2 ) < 0) @@ -2852,104 +2852,104 @@ herr_t H5TBdelete_field( hid_t loc_id, goto out; if (H5Dclose( did_2 ) < 0) goto out; - + /*------------------------------------------------------------------------- * delete 1st table *------------------------------------------------------------------------- */ - + if (H5Ldelete( loc_id, dset_name, H5P_DEFAULT ) < 0) return -1; - + /*------------------------------------------------------------------------- * rename 2nd table *------------------------------------------------------------------------- */ - + if (H5Lmove( loc_id, "new", H5L_SAME_LOC, dset_name, H5P_DEFAULT, H5P_DEFAULT ) < 0) return -1; - + /*------------------------------------------------------------------------- * attach the conforming table attributes *------------------------------------------------------------------------- */ - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0) return -1; - + /* open the dataset. */ if ((did_1 = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /* get the datatype */ if ((tid_1 = H5Dget_type( did_1 )) < 0) goto out; - + /* set the attributes */ if (H5TB_attach_attributes( table_title, loc_id, dset_name, nfields, tid_1 ) < 0) return -1; - + /*------------------------------------------------------------------------- * attach the fill attributes from previous table *------------------------------------------------------------------------- */ - + if (has_fill == 1) { if((sid_1 = H5Screate(H5S_SCALAR)) < 0) goto out; - + for(i = 0; i < nfields; i++) { - + /* get the member type */ if (( member_type_id = H5Tget_member_type( tid_1, (unsigned)i )) < 0) goto out; - + /* get the member offset */ member_offset = H5Tget_member_offset(tid_1, (unsigned)i); - + strcpy(attr_name, "FIELD_"); sprintf(aux, "%d", (int)i); strcat(attr_name, aux); sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - + if ((attr_id = H5Acreate2(did_1, attr_name, member_type_id, sid_1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - + if (H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0) goto out; - + if (H5Aclose(attr_id) < 0) goto out; - + /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; } - + /* close data space. */ if (H5Sclose(sid_1) < 0) goto out; - + } /*has_fill*/ - + /* release the datatype. */ if (H5Tclose( tid_1 ) < 0) goto out; - + /* end access to the dataset */ if (H5Dclose( did_1 ) < 0) goto out; - + /* Release resources. */ free ( tmp_fill_buf ); - + return 0; - -/* error zone */ + + /* error zone */ out: H5E_BEGIN_TRY { @@ -2961,74 +2961,74 @@ out: H5Sclose(sid_2); H5Tclose(tid_2); H5Pclose(pid_2); - + } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * - * Table attribute functions - * - *------------------------------------------------------------------------- - */ +* +* Table attribute functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5TBAget_title - * - * Purpose: Read the table title - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: January 30, 2001 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5TBAget_title +* +* Purpose: Read the table title +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: January 30, 2001 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5TBAget_title( hid_t loc_id, - char *table_title ) + char *table_title ) { - + /* Get the TITLE attribute */ if(H5LT_get_attribute_disk( loc_id, "TITLE", table_title ) < 0) return -1; - - + + return 0; - + } /*------------------------------------------------------------------------- - * Function: H5TBAget_fill - * - * Purpose: Read the table attribute fill values - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: January 30, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5TBAget_fill +* +* Purpose: Read the table attribute fill values +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: January 30, 2002 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ herr_t H5TBAget_fill( hid_t loc_id, - const char *dset_name, - hid_t dset_id, - unsigned char *dst_buf ) + const char *dset_name, + hid_t dset_id, + unsigned char *dst_buf ) { - + hsize_t nfields; hsize_t nrecords; char attr_name[255]; @@ -3036,20 +3036,20 @@ herr_t H5TBAget_fill( hid_t loc_id, hsize_t i; size_t *src_offset; int has_fill=0; - + /* get the number of records and fields */ if (H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0) return -1; - + src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)); - + if (src_offset == NULL ) return -1; - + /* get field info */ if (H5TBget_field_info( loc_id, dset_name, NULL, NULL, src_offset, NULL ) < 0) goto out; - + for ( i = 0; i < nfields; i++) { strcpy( attr_name, "FIELD_" ); @@ -3057,125 +3057,125 @@ herr_t H5TBAget_fill( hid_t loc_id, strcat( attr_name, aux ); sprintf( aux, "%s", "_FILL" ); strcat( attr_name, aux ); - + /* check if we have the _FILL attribute */ has_fill = H5LT_find_attribute( dset_id, attr_name ); - + /* get it */ if (has_fill == 1 ) { if(H5LT_get_attribute_disk( dset_id, attr_name, dst_buf+src_offset[i] ) < 0) goto out; } - + } - + free( src_offset ); - + return has_fill; - + out: free( src_offset ); return -1; - + } /*------------------------------------------------------------------------- - * - * Inquiry functions - * - *------------------------------------------------------------------------- - */ +* +* Inquiry functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5TBget_table_info - * - * Purpose: Gets the number of records and fields of a table - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 19, 2001 - * - * Comments: - * - * Modifications: - * May 08, 2003 - * In version 2.0 of Table, the number of records is stored as an - * attribute "NROWS" - * November 24, 2008 - * In version 3.0 of Table, "NROWS" was deprecated - * - * - *------------------------------------------------------------------------- - */ +* Function: H5TBget_table_info +* +* Purpose: Gets the number of records and fields of a table +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 19, 2001 +* +* Comments: +* +* Modifications: +* May 08, 2003 +* In version 2.0 of Table, the number of records is stored as an +* attribute "NROWS" +* November 24, 2008 +* In version 3.0 of Table, "NROWS" was deprecated +* +* +*------------------------------------------------------------------------- +*/ herr_t H5TBget_table_info ( hid_t loc_id, - const char *dset_name, - hsize_t *nfields, - hsize_t *nrecords ) + const char *dset_name, + hsize_t *nfields, + hsize_t *nrecords ) { hid_t tid=-1; hid_t sid=-1; hid_t did=-1; int num_members; hsize_t dims[1]; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) return -1; - + /* get the datatype */ if ((tid = H5Dget_type( did )) < 0) goto out; - + /* get the number of members */ if ((num_members = H5Tget_nmembers( tid )) < 0) goto out; - + /*------------------------------------------------------------------------- * get number of nfields *------------------------------------------------------------------------- */ - + if (nfields) { *nfields = num_members; } - - + + /*------------------------------------------------------------------------- * get number of records *------------------------------------------------------------------------- */ - + if (nrecords) { /* get the dataspace handle */ if ((sid = H5Dget_space( did )) < 0) goto out; - + /* get dimension */ if (H5Sget_simple_extent_dims( sid, dims, NULL) < 0) goto out; - + /* terminate access to the dataspace */ if (H5Sclose( sid ) < 0) goto out; - + *nrecords = dims[0]; } - + /* close */ if (H5Tclose( tid ) < 0) goto out; if (H5Dclose( did ) < 0) return -1; - + return 0; - + /* error zone */ out: H5E_BEGIN_TRY @@ -3185,33 +3185,33 @@ out: H5Tclose(tid); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TBget_field_info - * - * Purpose: Get information about fields - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 19, 2001 - * - * Comments: - * - * Modifications: - * - * - *------------------------------------------------------------------------- - */ +* Function: H5TBget_field_info +* +* Purpose: Get information about fields +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 19, 2001 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ herr_t H5TBget_field_info( hid_t loc_id, - const char *dset_name, - char *field_names[], - size_t *field_sizes, - size_t *field_offsets, - size_t *type_size ) + const char *dset_name, + char *field_names[], + size_t *field_sizes, + size_t *field_offsets, + size_t *type_size ) { hid_t did; /* dataset ID */ hid_t tid; /* file type ID */ @@ -3224,73 +3224,73 @@ herr_t H5TBget_field_info( hid_t loc_id, size_t member_offset; size_t size; hssize_t i; - + /* open the dataset. */ if ((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0) goto out; - + /* get the datatype */ if (( tid = H5Dget_type( did )) < 0) goto out; - + if ((n_tid = H5Tget_native_type(tid,H5T_DIR_DEFAULT)) < 0) goto out; - + /* get the type size */ size = H5Tget_size( n_tid ); - + if ( type_size ) { *type_size = size; } - + /* get the number of members */ if (( nfields = H5Tget_nmembers( tid )) < 0) goto out; - + /* iterate tru the members */ for ( i = 0; i < nfields; i++) { /* get the member name */ member_name = H5Tget_member_name( tid, (unsigned)i ); - + if (field_names ) { strcpy( field_names[i], member_name ); } - + /* get the member type */ if (( m_tid = H5Tget_member_type( tid,(unsigned) i )) < 0) goto out; if ((nm_tid = H5Tget_native_type(m_tid,H5T_DIR_DEFAULT)) < 0) goto out; - + /* get the member size */ member_size = H5Tget_size( nm_tid ); - + if(field_sizes ) { field_sizes[i] = member_size; } - + /* get the member offset */ member_offset = H5Tget_member_offset( n_tid,(unsigned) i ); - + if(field_offsets ) { field_offsets[i] = member_offset; } - + /* close the member types */ if (H5Tclose( m_tid ) < 0) goto out; if (H5Tclose( nm_tid ) < 0) goto out; - + free( member_name ); - + } /* i */ - + /* close */ if (H5Tclose( tid ) < 0) goto out; @@ -3298,10 +3298,10 @@ herr_t H5TBget_field_info( hid_t loc_id, goto out; if (H5Dclose( did ) < 0) return -1; - + return 0; - - /* error zone */ + + /* error zone */ out: H5E_BEGIN_TRY { @@ -3310,36 +3310,36 @@ out: H5Tclose(n_tid); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * - * internal functions - * - *------------------------------------------------------------------------- - */ +* +* internal functions +* +*------------------------------------------------------------------------- +*/ /*------------------------------------------------------------------------- - * Function: H5TB_find_field - * - * Purpose: Find a string field - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 19, 2001 - * - *------------------------------------------------------------------------- - */ +* Function: H5TB_find_field +* +* Purpose: Find a string field +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 19, 2001 +* +*------------------------------------------------------------------------- +*/ static int H5TB_find_field( const char *field, const char *field_list ) { const char *start = field_list; const char *end; - + while ( (end = strstr( start, "," )) != 0 ) { size_t count = end - start; @@ -3347,105 +3347,105 @@ int H5TB_find_field( const char *field, const char *field_list ) return 1; start = end + 1; } - + if(strcmp( start, field ) == 0 ) return 1; - + return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TB_attach_attributes - * - * Purpose: Private function that creates the conforming table attributes; - * Used by H5TBcombine_tables; not used by H5TBmake_table, which does not read - * the fill value attributes from an existing table - * - * Return: Success: 0, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 6, 2001 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5TB_attach_attributes +* +* Purpose: Private function that creates the conforming table attributes; +* Used by H5TBcombine_tables; not used by H5TBmake_table, which does not read +* the fill value attributes from an existing table +* +* Return: Success: 0, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: December 6, 2001 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ static herr_t H5TB_attach_attributes( const char *table_title, - hid_t loc_id, - const char *dset_name, - hsize_t nfields, - hid_t tid ) + hid_t loc_id, + const char *dset_name, + hsize_t nfields, + hid_t tid ) { - + char attr_name[255]; char *member_name; char aux[255]; hsize_t i; - + /* attach the CLASS attribute */ if (H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0) goto out; - + /* attach the VERSION attribute */ if (H5LTset_attribute_string( loc_id, dset_name, "VERSION", TABLE_VERSION ) < 0) goto out; - + /* attach the TITLE attribute */ if (H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0) goto out; - + /* attach the FIELD_ name attribute */ for ( i = 0; i < nfields; i++) { - + /* get the member name */ member_name = H5Tget_member_name( tid, (unsigned)i ); - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int)i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_NAME" ); strcat( attr_name, aux ); - + /* attach the attribute */ if (H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0) goto out; - + free( member_name ); - + } - + return 0; - + out: return -1; - + } /*------------------------------------------------------------------------- - * Function: H5TB_create_type - * - * Purpose: Private function that creates a memory type ID - * - * Return: Success: the memory type ID, Failure: -1 - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 31, 2004 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ +* Function: H5TB_create_type +* +* Purpose: Private function that creates a memory type ID +* +* Return: Success: the memory type ID, Failure: -1 +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: March 31, 2004 +* +* Comments: +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ static hid_t H5TB_create_type(hid_t loc_id, @@ -3462,31 +3462,31 @@ hid_t H5TB_create_type(hid_t loc_id, hsize_t nfields; char **fnames; unsigned i; - + /* get the number of fields */ if (H5TBget_table_info(loc_id,dset_name,&nfields,NULL) < 0) return -1; - - if ((fnames=malloc(sizeof(char*)*(size_t)nfields))==NULL) + + if ((fnames = (char**) malloc(sizeof(char*)*(size_t)nfields))==NULL) return -1; - + for ( i = 0; i < nfields; i++) { - if ((fnames[i]=malloc(sizeof(char)*HLTB_MAX_FIELD_LEN))==NULL) + if ((fnames[i] = (char*) malloc(sizeof(char)*HLTB_MAX_FIELD_LEN))==NULL) { free(fnames); return -1; } } - + /* get field info */ if (H5TBget_field_info(loc_id,dset_name,fnames,NULL,NULL,NULL) < 0) goto out; - + /* create the memory data type */ if ((mem_type_id=H5Tcreate(H5T_COMPOUND,type_size)) < 0) goto out; - + /* get each field ID and adjust its size, if necessary */ for ( i = 0; i < nfields; i++) { @@ -3507,15 +3507,15 @@ hid_t H5TB_create_type(hid_t loc_id, if (H5Tclose(nmtype_id) < 0) goto out; } - + for ( i=0; i table_size ) goto out; - + /* get the dataspace handle */ if ((sid = H5Dget_space( dataset_id )) < 0) goto out; - + /* define a hyperslab in the dataset of the size of the records */ offset[0] = start; count[0] = nrecords; if (H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) goto out; - + /* create a memory dataspace handle */ mem_size[0] = count[0]; if ((m_sid = H5Screate_simple( 1, mem_size, NULL )) < 0) goto out; if ((H5Dread( dataset_id, mem_type_id, m_sid, sid, H5P_DEFAULT, buf)) < 0) goto out; - + /* close */ if (H5Sclose( m_sid ) < 0) goto out; if (H5Sclose( sid ) < 0) goto out; - + return 0; - + out: H5E_BEGIN_TRY { diff --git a/hl/src/Makefile.am b/hl/src/Makefile.am index 37bff7b..3ee186e 100644 --- a/hl/src/Makefile.am +++ b/hl/src/Makefile.am @@ -19,6 +19,7 @@ # include $(top_srcdir)/config/commence.am +include $(top_srcdir)/config/lt_vers.am # Add include directories to the C preprocessor flags AM_CPPFLAGS=-I$(top_srcdir)/src @@ -26,6 +27,9 @@ AM_CPPFLAGS=-I$(top_srcdir)/src # This library is our main target. lib_LTLIBRARIES=libhdf5_hl.la +# Add libtool numbers to the HDF5 hl library (from config/lt_vers.am) +libhdf5_hl_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) + libhdf5_hl_la_SOURCES=H5DS.c H5IM.c H5LT.c H5LTanalyze.c H5LTparse.c H5PT.c H5TB.c # Public header files (to be installed) diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index bb5fd25..d5cd6be 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -52,7 +52,8 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/config/commence.am \ - $(top_srcdir)/config/conclude.am COPYING + $(top_srcdir)/config/conclude.am \ + $(top_srcdir)/config/lt_vers.am COPYING TESTS = subdir = hl/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -75,6 +76,9 @@ libhdf5_hl_la_LIBADD = am_libhdf5_hl_la_OBJECTS = H5DS.lo H5IM.lo H5LT.lo H5LTanalyze.lo \ H5LTparse.lo H5PT.lo H5TB.lo libhdf5_hl_la_OBJECTS = $(am_libhdf5_hl_la_OBJECTS) +libhdf5_hl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libhdf5_hl_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles @@ -343,11 +347,20 @@ TRACE = perl $(top_srcdir)/bin/trace # *.clog are from the MPE option. CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# Add libtool shared library version numbers to the HDF5 library +# See libtool versioning documentation online. +LT_VERS_INTERFACE = 6 +LT_VERS_REVISION = 29 +LT_VERS_AGE = 0 + # Add include directories to the C preprocessor flags AM_CPPFLAGS = -I$(top_srcdir)/src # This library is our main target. lib_LTLIBRARIES = libhdf5_hl.la + +# Add libtool numbers to the HDF5 hl library (from config/lt_vers.am) +libhdf5_hl_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) libhdf5_hl_la_SOURCES = H5DS.c H5IM.c H5LT.c H5LTanalyze.c H5LTparse.c H5PT.c H5TB.c # Public header files (to be installed) @@ -372,12 +385,12 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -429,7 +442,7 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libhdf5_hl.la: $(libhdf5_hl_la_OBJECTS) $(libhdf5_hl_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libhdf5_hl_la_OBJECTS) $(libhdf5_hl_la_LIBADD) $(LIBS) + $(libhdf5_hl_la_LINK) -rpath $(libdir) $(libhdf5_hl_la_OBJECTS) $(libhdf5_hl_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -494,7 +507,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -683,6 +696,19 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES help: @$(top_srcdir)/bin/makehelp +# 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. + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index efe8a96..e527341 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -390,8 +390,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -482,7 +482,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index e4d4260..6951619 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -24,11 +24,13 @@ static herr_t verify_scale(hid_t dset, unsigned dim, hid_t scale, void *visitor_data); static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale, void *visitor_data); static herr_t match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor_data); -static herr_t op_bogus(hid_t did, unsigned dim, hid_t dsid, void *visitor_data); +static herr_t op_continue(hid_t did, unsigned dim, hid_t dsid, void *visitor_data); +static herr_t op_stop(hid_t did, unsigned dim, hid_t dsid, void *visitor_data); /* prototypes */ static int test_simple(void); static int test_errors(void); +static int test_errors2(void); static int test_rank(void); static int test_types(void); static int test_iterators(void); @@ -43,14 +45,12 @@ static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf ) #define DIM3_SIZE 2 #define DIM0 0 #define DIM1 1 -#define DIM2 2 #define DS_1_NAME "ds_a_1" #define DS_11_NAME "ds_a_11" #define DS_2_NAME "ds_a_2" #define DS_21_NAME "ds_a_21" #define DS_22_NAME "ds_a_22" -#define DS_3_NAME "ds_a_3" #define SCALE_1_NAME "Latitude set 0" #define SCALE_11_NAME "Latitude set 1" @@ -67,8 +67,7 @@ static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf ) #define FILE4 "test_ds4.h5" #define FILE5 "test_ds5.h5" #define FILE6 "test_ds6.h5" - - +#define FILE7 "test_ds7.h5" /*------------------------------------------------------------------------- * the main program @@ -80,10 +79,12 @@ int main(void) nerrors += test_simple() < 0 ?1:0; nerrors += test_errors() < 0 ?1:0; + nerrors += test_errors2() < 0 ?1:0; nerrors += test_rank() < 0 ?1:0; nerrors += test_iterators() < 0 ?1:0; nerrors += test_types() < 0 ?1:0; nerrors += test_data() < 0 ?1:0; + if(nerrors) goto error; printf("All dimension scales tests passed.\n"); @@ -101,6 +102,7 @@ error: * Functions tested: * * H5DSattach_scale + * H5DSget_num_scales * H5DSdetach_scale * H5DSset_label * H5DSget_label @@ -108,7 +110,6 @@ error: * H5DSget_scale_name * H5DSis_scale * H5DSiterate_scales - * H5DSget_num_scales * *------------------------------------------------------------------------- */ @@ -116,13 +117,13 @@ error: static int test_simple(void) { - hid_t fid; /* file ID */ + hid_t fid = -1; /* file ID */ hid_t did = -1; /* dataset ID */ - hid_t dsid; /* DS dataset ID */ - hid_t sid; /* space ID */ - hid_t gid; /* group ID */ - int rank = RANK; /* rank of data dataset */ - int rankds = 1; /* rank of DS dataset */ + hid_t dsid = -1; /* DS dataset ID */ + hid_t sid = -1; /* space ID */ + hid_t gid = -1; /* group ID */ + int rank = RANK; /* rank of data dataset */ + int rankds = 1; /* rank of DS dataset */ hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */ int buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12}; /* data of data dataset */ hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */ @@ -191,9 +192,9 @@ static int test_simple(void) if(H5LTmake_dataset_int(fid,DS_22_NAME,rankds,s2_dim,s22_wbuf) < 0) goto out; - + /*------------------------------------------------------------------------- - * test 1: attach scale + * H5DSattach_scale *------------------------------------------------------------------------- */ @@ -333,10 +334,11 @@ static int test_simple(void) /*------------------------------------------------------------------------- - * test 2: get number of scales + * H5DSget_num_scales *------------------------------------------------------------------------- */ + TESTING2("get number of scales"); /*------------------------------------------------------------------------- @@ -423,7 +425,7 @@ static int test_simple(void) /*------------------------------------------------------------------------- - * test 3: detach scales + * H5DSdetach_scale *------------------------------------------------------------------------- */ @@ -952,16 +954,12 @@ static int test_simple(void) goto out; - PASSED(); - /*------------------------------------------------------------------------- * create a dataset and attach only to 1 dimension *------------------------------------------------------------------------- */ - TESTING2("attach only to 1 dimension"); - /* make a dataset */ if(H5LTmake_dataset_int(fid,"dset_e",rank,dims,NULL) < 0) goto out; @@ -1004,8 +1002,9 @@ static int test_simple(void) PASSED(); + /*------------------------------------------------------------------------- - * test 4: set/get label + * H5DSset_label, H5DSget_label *------------------------------------------------------------------------- */ @@ -1100,9 +1099,11 @@ static int test_simple(void) PASSED(); /*------------------------------------------------------------------------- - * test 5: set scale/get scale name + * H5DSget_scale_name, H5DSget_scale_name *------------------------------------------------------------------------- */ + + TESTING2("set scale/get scale name"); if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0) @@ -1206,10 +1207,18 @@ static int test_simple(void) PASSED(); /*------------------------------------------------------------------------- + * H5DSiterate_scales + *------------------------------------------------------------------------- + */ + + + TESTING2("iterate scales"); + + + /*------------------------------------------------------------------------- * test 6: test iterate scales with a function verify_scale *------------------------------------------------------------------------- */ - TESTING2("iterate scales (verify scale)"); /* get the dataset id for "dset_a" */ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0) @@ -1233,14 +1242,11 @@ static int test_simple(void) if(H5Dclose(did) < 0) goto out; - PASSED(); - /*------------------------------------------------------------------------- - * test 7: test iterate scales with a function read_scale + * test iterate scales with a function read_scale *------------------------------------------------------------------------- */ - TESTING2("iterate scales (read scale values)"); /* get the dataset id for "dset_a" */ @@ -1265,13 +1271,11 @@ static int test_simple(void) if(H5Dclose(did) < 0) goto out; - PASSED(); /*------------------------------------------------------------------------- - * test 8: test iterate scales with a function match_dim_scale + * test iterate scales with a function match_dim_scale *------------------------------------------------------------------------- */ - TESTING2("iterate scales (verify the scale sizes match)"); /* get the dataset id for "dset_a" */ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0) @@ -1316,13 +1320,11 @@ static int test_simple(void) if(H5Sclose(sid) < 0) goto out; - PASSED(); /*------------------------------------------------------------------------- - * test 9: test iterate scales with a function match_dim_scale + * test iterate scales with a function match_dim_scale *------------------------------------------------------------------------- */ - TESTING2("iterate scales (verify the scale sizes do not match)"); /*------------------------------------------------------------------------- * create 3 datasets: 1 "data" dataset and dimension scales (some are empty) @@ -1411,6 +1413,10 @@ static int test_simple(void) case 1: /* for DIM 1, we get no valid scales */ if(match_size!=0 && idx!=0) goto out; + break; + default: + assert(0); + break; }/*switch*/ }/*for*/ } @@ -1434,11 +1440,15 @@ static int test_simple(void) return 0; - /* error zone, gracefully close */ + /* error zone */ out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Dclose(did); + H5Dclose(dsid); H5Fclose(fid); + H5Sclose(sid); + H5Gclose(gid); } H5E_END_TRY; H5_FAILED(); return FAIL; @@ -1508,14 +1518,14 @@ static herr_t verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visit static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) { int ret = 0; /* define a default zero value for return. This will cause the iterator to continue */ - hid_t sid; /* space ID */ + hid_t sid = -1; /* space ID */ hid_t tid = -1; /* file type ID */ hid_t mtid = -1; /* memory type ID */ hssize_t nelmts; /* number of data elements */ char *buf=NULL; /* data buffer */ size_t size; int i; - char *data=visitor_data; + char *data = (char*) visitor_data; /* unused */ dset=dset; @@ -1568,14 +1578,17 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor return ret; - /* error zone, gracefully close */ + /* error zone */ out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Sclose(sid); H5Tclose(tid); H5Tclose(mtid); if(buf) + { free(buf); + } } H5E_END_TRY; return FAIL; @@ -1657,7 +1670,8 @@ static herr_t match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor return ret; out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Sclose(sid); } H5E_END_TRY; return FAIL; @@ -1665,9 +1679,10 @@ out: /*------------------------------------------------------------------------- - * Function: op_bogus + * Function: op_continue * - * Purpose: example operator function used by H5DSiterate_scales, that does nothing + * Purpose: example operator function used by H5DSiterate_scales that continues + * iteration and increments visitor_data (Note: int*) * * Return: * The return values from an operator are: @@ -1680,19 +1695,58 @@ out: *------------------------------------------------------------------------- */ -static herr_t op_bogus(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) +static herr_t op_continue(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) { /* Stop compiler from whining about "unused parameters" */ dset = dset; dim = dim; scale_id = scale_id; - visitor_data = visitor_data; + + if ( visitor_data != NULL ) + { + (*(int *)visitor_data)++; + } /* define a default zero value for return. This will cause the iterator to continue */ return 0; } +/*------------------------------------------------------------------------- + * Function: op_stop + * + * Purpose: example operator function used by H5DSiterate_scales that stops + * iteration and increments visitor_data (Note: int*) + * + * Return: + * The return values from an operator are: + * Zero causes the iterator to continue, returning zero when all group members have been processed. + * Positive causes the iterator to immediately return that positive value, indicating + * short-circuit success. The iterator can be restarted at the next group member. + * Negative causes the iterator to immediately return that value, indicating failure. + * The iterator can be restarted at the next group member. + * + *------------------------------------------------------------------------- + */ + +static herr_t op_stop(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) +{ + /* Stop compiler from whining about "unused parameters" */ + dset = dset; + dim = dim; + scale_id = scale_id; + + if ( visitor_data != NULL ) + { + (*(int *)visitor_data)++; + } + + /* define a default 1 value for return. This will cause the iterator to stop */ + return 1; +} + + + /*------------------------------------------------------------------------- * test error conditions @@ -2057,9 +2111,10 @@ static int test_errors(void) return 0; - /* error zone, gracefully close */ + /* error zone */ out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Sclose(sid); H5Sclose(sidds); H5Dclose(did); @@ -2086,8 +2141,8 @@ static int test_iterators(void) hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */ hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */ hid_t gid = -1; /* group ID */ - hid_t did; /* dataset ID */ - hid_t dsid; /* scale ID */ + hid_t did = -1; /* dataset ID */ + hid_t dsid = -1; /* scale ID */ char dname[30]; /* dataset name */ int i; @@ -2186,7 +2241,7 @@ static int test_iterators(void) } /* iterate trough the 1st dimension of "dset_a" */ - if(H5DSiterate_scales(did,0,NULL,op_bogus,NULL) < 0) + if(H5DSiterate_scales(did,0,NULL,op_continue,NULL) < 0) goto out; /* close */ @@ -2232,7 +2287,7 @@ static int test_iterators(void) goto out; /* iterate */ - if(H5DSiterate_scales(did, 0, NULL, op_bogus, NULL) == SUCCEED) + if(H5DSiterate_scales(did, 0, NULL, op_continue, NULL) == SUCCEED) goto out; /* close */ @@ -2248,10 +2303,12 @@ static int test_iterators(void) return 0; - /* error zone, gracefully close */ + /* error zone */ out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Gclose(gid); + H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; H5_FAILED(); @@ -2269,8 +2326,8 @@ static int test_rank(void) hid_t fid; /* file ID */ hid_t did = -1; /* dataset ID */ hid_t dsid = -1; /* scale ID */ - hid_t sid; /* space ID */ - hid_t sidds; /* space ID */ + hid_t sid = -1; /* space ID */ + hid_t sidds = -1; /* space ID */ hsize_t dims1[1] = {DIM1_SIZE}; /* size of data dataset */ hsize_t dims2[2] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */ hsize_t dims3[3] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE}; /* size of data dataset */ @@ -2455,11 +2512,14 @@ static int test_rank(void) return 0; - /* error zone, gracefully close */ + /* error zone */ out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Dclose(did); H5Dclose(dsid); + H5Sclose(sidds); + H5Sclose(sid); H5Fclose(fid); } H5E_END_TRY; H5_FAILED(); @@ -2632,9 +2692,10 @@ static int test_types(void) return 0; - /* error zone, gracefully close */ + /* error zone */ out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Dclose(did); H5Dclose(dsid); H5Fclose(fid); @@ -2790,9 +2851,10 @@ static int test_data(void) return 0; - /* error zone, gracefully close */ + /* error zone */ out: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Dclose(did); H5Dclose(dsid); H5Fclose(fid); @@ -2882,3 +2944,200 @@ static int read_data( const char* fname, } +/*------------------------------------------------------------------------- + * test parameter errors + *------------------------------------------------------------------------- + */ + +static int test_errors2(void) +{ + hid_t fid; /* file ID */ + hid_t did = -1; /* dataset ID */ + hid_t dsid = -1; /* scale ID */ + hsize_t dimd[2] = {3,3}; /* size of data dataset */ + hsize_t dims[1] = {3}; /* size of scale dataset */ + char lbuf[255]; /* label buffer */ + ssize_t label_len; /* label lenght */ + int scale_idx; /* scale index */ + int nscales; /* number of scales in DIM */ + int count; /* visitor data */ + + printf("Testing parameter errors\n"); + + /*------------------------------------------------------------------------- + * create a file, a dataset, scales + *------------------------------------------------------------------------- + */ + + /* create a file using default properties */ + if ((fid=H5Fcreate(FILE7,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + goto out; + + /* make a dataset */ + if (H5LTmake_dataset_int(fid,"dset",2,dimd,NULL) < 0) + goto out; + + /* make a scale dataset */ + if(H5LTmake_dataset_int(fid,"ds1",1,dims,NULL) < 0) + goto out; + + /* make a scale dataset */ + if(H5LTmake_dataset_int(fid,"ds2",1,dims,NULL) < 0) + goto out; + + + TESTING2("attach scales"); + + + /*------------------------------------------------------------------------- + * attach with invalid indices + *------------------------------------------------------------------------- + */ + + if ((did = H5Dopen2(fid,"dset", H5P_DEFAULT)) < 0) + goto out; + if ((dsid = H5Dopen2(fid,"ds1", H5P_DEFAULT)) < 0) + goto out; + if (H5DSattach_scale(did,dsid,2) == SUCCEED) + goto out; + if (H5DSattach_scale(did,dsid,0) < 0) + goto out; + if (H5Dclose(dsid) < 0) + goto out; + if (H5Dclose(did) < 0) + goto out; + + PASSED(); + + TESTING2("detach scales"); + + /*------------------------------------------------------------------------- + * detach with invalid indices + *------------------------------------------------------------------------- + */ + if ((did = H5Dopen2(fid,"dset", H5P_DEFAULT)) < 0) + goto out; + if ((dsid = H5Dopen2(fid,"ds1", H5P_DEFAULT)) < 0) + goto out; + if (H5DSdetach_scale(did,dsid,2) == SUCCEED) + goto out; + if (H5DSdetach_scale(did,dsid,0) < 0) + goto out; + if (H5Dclose(dsid) < 0) + goto out; + if (H5Dclose(did) < 0) + goto out; + + PASSED(); + + TESTING2("set/get label"); + + /*------------------------------------------------------------------------- + * set/get label invalid indices + *------------------------------------------------------------------------- + */ + if ((did = H5Dopen2(fid,"dset", H5P_DEFAULT)) < 0) + goto out; + if (H5DSset_label(did,2,"label")== SUCCEED) + goto out; + if (H5DSset_label(did,0,"label") < 0) + goto out; + if (H5DSget_label(did,2,lbuf,sizeof(lbuf)) == SUCCEED) + goto out; + if ((label_len=H5DSget_label(did,0,NULL,0)) < 0) + goto out; + if ( label_len != strlen("label") ) + goto out; + if (H5DSget_label(did,0,lbuf,sizeof(lbuf)) < 0) + goto out; + if (H5Dclose(did) < 0) + goto out; + + PASSED(); + + TESTING2("iterate scales"); + + + /*------------------------------------------------------------------------- + * iterate_scales invalid indices and return DS_IDX and visitor data + *------------------------------------------------------------------------- + */ + if ((did = H5Dopen2(fid,"dset", H5P_DEFAULT)) < 0) + goto out; + + if ((dsid = H5Dopen2(fid,"ds1", H5P_DEFAULT)) < 0) + goto out; + if (H5DSattach_scale(did,dsid,0) < 0) + goto out; + if (H5Dclose(dsid) < 0) + goto out; + + if ((dsid = H5Dopen2(fid,"ds2", H5P_DEFAULT)) < 0) + goto out; + if (H5DSattach_scale(did,dsid,0) < 0) + goto out; + if (H5Dclose(dsid) < 0) + goto out; + + if((nscales = H5DSget_num_scales(did,0)) < 0) + goto out; + if(nscales!=2) + goto out; + + /* invalid DIM */ + if (H5DSiterate_scales(did,2,NULL,op_continue,NULL)== SUCCEED) + goto out; + /* invalid DS_IDX */ + scale_idx = 2; + if (H5DSiterate_scales(did,0,&scale_idx,op_continue,NULL)== SUCCEED) + goto out; + + /* continue iteration */ + scale_idx = 0; + count = 0; + if (H5DSiterate_scales(did,0,&scale_idx,op_continue,(void *)&count) < 0) + goto out; + + if ( scale_idx != 1 && count != nscales ) + { + goto out; + } + + /* stop iteration */ + scale_idx = 0; + count = 0; + if (H5DSiterate_scales(did,0,&scale_idx,op_stop,(void *)&count) < 0) + goto out; + + if ( scale_idx != 0 && count != 1 ) + { + goto out; + } + + + if (H5Dclose(did) < 0) + goto out; + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + if(H5Fclose(fid) < 0) + goto out; + + PASSED(); + + return 0; + + /* error zone */ +out: + H5E_BEGIN_TRY + { + H5Dclose(did); + H5Dclose(dsid); + H5Fclose(fid); + } H5E_END_TRY; + H5_FAILED(); + return FAIL; +} + diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 2a365e2..426ae1d 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -61,9 +61,9 @@ static int read_palette(const char* file_name, rgb_t *palette, size_t palette_si unsigned char *image_data = NULL; /*------------------------------------------------------------------------- - * the main program - *------------------------------------------------------------------------- - */ +* the main program +*------------------------------------------------------------------------- +*/ int main(void) { @@ -83,9 +83,9 @@ error: } /*------------------------------------------------------------------------- - * a simple test that generates images and palettes - *------------------------------------------------------------------------- - */ +* a simple test that generates images and palettes +*------------------------------------------------------------------------- +*/ static int test_simple(void) { @@ -94,6 +94,7 @@ static int test_simple(void) hsize_t planes; hid_t fid; int i, j, n, space; + hsize_t u; char interlace[20]; hssize_t npals; @@ -142,7 +143,7 @@ static int test_simple(void) } } - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * define a palette, blue to red tones *------------------------------------------------------------------------- */ @@ -156,7 +157,7 @@ static int test_simple(void) /* Create a new HDF5 file using default properties. */ fid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * Indexed image test *------------------------------------------------------------------------- */ @@ -182,9 +183,9 @@ static int test_simple(void) if ( H5IMread_image( fid, IMAGE1_NAME, buf1_out ) < 0 ) goto out; - for (i = 0; i < height*width*planes; i++) + for (u = 0; u < height*width*planes; u++) { - if ( buf1[i] != buf1_out[i] ) + if ( buf1[u] != buf1_out[u] ) goto out; } @@ -192,7 +193,7 @@ static int test_simple(void) PASSED(); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * True color image test *------------------------------------------------------------------------- */ @@ -210,16 +211,16 @@ static int test_simple(void) if ( H5IMread_image( fid, IMAGE2_NAME, buf2_out ) < 0 ) goto out; - for (i = 0; i < height*width*planes; i++) + for (u = 0; u < height*width*planes; u++) { - if ( buf2[i] != buf2_out[i] ) + if ( buf2[u] != buf2_out[u] ) goto out; } PASSED(); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * H5IMget_npalettes test *------------------------------------------------------------------------- */ @@ -229,7 +230,7 @@ static int test_simple(void) if ( H5IMget_npalettes( fid, IMAGE1_NAME, &npals ) < 0 ) goto out; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * H5IMget_palette_info test *------------------------------------------------------------------------- */ @@ -243,7 +244,7 @@ static int test_simple(void) goto out; } - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * H5IMget_palette test *------------------------------------------------------------------------- */ @@ -257,7 +258,7 @@ static int test_simple(void) goto out; } - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * H5IMis_image test *------------------------------------------------------------------------- */ @@ -268,7 +269,7 @@ static int test_simple(void) if ( H5IMis_image( fid, IMAGE2_NAME ) < 0 ) goto out; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * H5IMis_palette test *------------------------------------------------------------------------- */ @@ -276,7 +277,7 @@ static int test_simple(void) if ( H5IMis_palette( fid, PAL_NAME ) < 0 ) goto out; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * end tests *------------------------------------------------------------------------- */ @@ -301,9 +302,9 @@ out: /*------------------------------------------------------------------------- - * read sample realistic image data from ASCII files - *------------------------------------------------------------------------- - */ +* read sample realistic image data from ASCII files +*------------------------------------------------------------------------- +*/ static int test_data(void) { @@ -321,7 +322,7 @@ static int test_data(void) printf("Testing read ascii image data and generate images\n"); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * read 8bit image data *------------------------------------------------------------------------- */ @@ -341,7 +342,7 @@ static int test_data(void) TESTING2("attaching palettes"); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * palette #1. rainbow palette. data is contained in "pal_rgb.h" *------------------------------------------------------------------------- */ @@ -358,7 +359,7 @@ static int test_data(void) if (H5IMlink_palette(fid,IMAGE1_NAME,PAL1_NAME)<0) goto out; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * palette #2. sepia palette. * read a PAL file and attach the palette to the HDF5 file *------------------------------------------------------------------------- @@ -384,7 +385,7 @@ static int test_data(void) if (H5IMlink_palette(fid,IMAGE1_NAME,PAL2_NAME)<0) goto out; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * palette #3. earth palette. * read a PAL file and attach the palette to the HDF5 file *------------------------------------------------------------------------- @@ -413,7 +414,7 @@ static int test_data(void) PASSED(); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * palette #4. blue-red * make a palette whith blue to red colors *------------------------------------------------------------------------- @@ -434,7 +435,7 @@ static int test_data(void) goto out; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * true color image example with pixel interlace *------------------------------------------------------------------------- */ @@ -469,7 +470,7 @@ static int test_data(void) PASSED(); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ @@ -488,16 +489,16 @@ out: } - /* - The following test provides an examples of how to generate HDF5 image data from - floating point data. In the example we use real life topographic data - (from the North American hemisphere). In the dataset sea values are represented - as negative numbers and land values are represented as positive numbers. - The example generates 3 HDF5 images, one that generates an image from all the values, - another that generates an image from the land values and another that generates an - image from the sea values. - For the example we used data from MODB, the Mediterranean Oceanic Data Base - http://modb.oce.ulg.ac.be/ +/* +The following test provides an examples of how to generate HDF5 image data from +floating point data. In the example we use real life topographic data +(from the North American hemisphere). In the dataset sea values are represented +as negative numbers and land values are represented as positive numbers. +The example generates 3 HDF5 images, one that generates an image from all the values, +another that generates an image from the land values and another that generates an +image from the sea values. +For the example we used data from MODB, the Mediterranean Oceanic Data Base +http://modb.oce.ulg.ac.be/ */ @@ -519,7 +520,7 @@ static int test_generate(void) printf("Testing read and process data and make indexed images\n"); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * compose the name of the file to open, using the srcdir, if appropriate *------------------------------------------------------------------------- */ @@ -543,40 +544,40 @@ static int test_generate(void) return -1; } -/* -!The first line of the ASCII file contains the dimension of the array : -! IMAX, JMAX, KMAX. The integers are stored with the FORTRAN format I5. -!The second line contains the exclusion value, the minimum and the maximum value of this -! file. These numbers are stored with the FORTRAN format E12.5. -! The remaining lines contains the data of the array, with 5 numbers per line -! (except the last line for each I-line). -! The array is stored in horizontal slices from sea surface to sea bottom and from -! north to south. So the indexes go from : -! -! DO K = KMAX to 1 -! DO J = JMAX to 1 -! DO I = 1 to IMAX -! read -! OD -! OD -! OD -! -! ____________________________ -! / /| (imax,jmax,kmax) -! / sea surface / | -! / / | -! /__________________________ / | -! | | | -! | | | (imax,jmax,1) n -! | | / / -! | | / / -! ^ j | | / w <-----o-----> e -! k | / |__________________________|/ / -! | / (imax,1,1) / -! |----------> s -! i -! -*/ + /* + !The first line of the ASCII file contains the dimension of the array : + ! IMAX, JMAX, KMAX. The integers are stored with the FORTRAN format I5. + !The second line contains the exclusion value, the minimum and the maximum value of this + ! file. These numbers are stored with the FORTRAN format E12.5. + ! The remaining lines contains the data of the array, with 5 numbers per line + ! (except the last line for each I-line). + ! The array is stored in horizontal slices from sea surface to sea bottom and from + ! north to south. So the indexes go from : + ! + ! DO K = KMAX to 1 + ! DO J = JMAX to 1 + ! DO I = 1 to IMAX + ! read + ! OD + ! OD + ! OD + ! + ! ____________________________ + ! / /| (imax,jmax,kmax) + ! / sea surface / | + ! / / | + ! /__________________________ / | + ! | | | + ! | | | (imax,jmax,1) n + ! | | / / + ! | | / / + ! ^ j | | / w <-----o-----> e + ! k | / |__________________________|/ / + ! | / (imax,1,1) / + ! |----------> s + ! i + ! + */ fscanf( f, "%d %d %d", &imax, &jmax, &kmax ); @@ -592,7 +593,7 @@ static int test_generate(void) } fclose( f ); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * transform the data from floating point to unsigned char * we are processing all the data here *------------------------------------------------------------------------- @@ -611,7 +612,7 @@ static int test_generate(void) PASSED(); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * transform the data from floating point to unsigned char * here we just process the land data *------------------------------------------------------------------------- @@ -633,7 +634,7 @@ static int test_generate(void) PASSED(); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * transform the data from floating point to unsigned char * here we just process the sea data *------------------------------------------------------------------------- @@ -655,7 +656,7 @@ static int test_generate(void) PASSED(); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * make a palette and attach it to the datasets *------------------------------------------------------------------------- */ @@ -677,7 +678,7 @@ static int test_generate(void) PASSED(); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ @@ -697,25 +698,25 @@ out: /*------------------------------------------------------------------------- - * read_data - * utility function to read ASCII image data - * the files have a header of the type - * - * components - * n - * height - * n - * width - * n - * - * followed by the image data - * - *------------------------------------------------------------------------- - */ +* read_data +* utility function to read ASCII image data +* the files have a header of the type +* +* components +* n +* height +* n +* width +* n +* +* followed by the image data +* +*------------------------------------------------------------------------- +*/ static int read_data( const char* fname, /*IN*/ - hsize_t *width, /*OUT*/ - hsize_t *height /*OUT*/ ) + hsize_t *width, /*OUT*/ + hsize_t *height /*OUT*/ ) { int i, n; int color_planes; @@ -725,7 +726,7 @@ static int read_data( const char* fname, /*IN*/ char *srcdir = getenv("srcdir"); /* the source directory */ char data_file[512]=""; /* buffer to hold name of existing data file */ - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * compose the name of the file to open, using "srcdir", if appropriate *------------------------------------------------------------------------- */ @@ -737,7 +738,7 @@ static int read_data( const char* fname, /*IN*/ } strcat(data_file,fname); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ @@ -781,17 +782,17 @@ static int read_data( const char* fname, /*IN*/ /*------------------------------------------------------------------------- - * read_palette - * Read an ASCII palette file .PAL into an array - * the files have a header of the type - * - * Parameters: - * fname - name of file to read. - * palette - array of rgb_t to store the read palette. - * palette_size - number of elements in 'palette' array - * - *------------------------------------------------------------------------- - */ +* read_palette +* Read an ASCII palette file .PAL into an array +* the files have a header of the type +* +* Parameters: +* fname - name of file to read. +* palette - array of rgb_t to store the read palette. +* palette_size - number of elements in 'palette' array +* +*------------------------------------------------------------------------- +*/ #define STRING_JASC "JASC-PAL" @@ -803,118 +804,118 @@ static int read_palette(const char* fname, rgb_t *palette, size_t palette_size) { - FILE *file; - char buffer[80]; - unsigned u; - unsigned int red; - unsigned int green; - unsigned int blue; - unsigned nentries; - char *srcdir = getenv("srcdir"); /* the source directory */ - char data_file[512]; /* buffer to hold name of existing data file */ + FILE *file; + char buffer[80]; + unsigned u; + unsigned int red; + unsigned int green; + unsigned int blue; + unsigned nentries; + char *srcdir = getenv("srcdir"); /* the source directory */ + char data_file[512]; /* buffer to hold name of existing data file */ -/*------------------------------------------------------------------------- - * compose the name of the file to open, using "srcdir", if appropriate - *------------------------------------------------------------------------- - */ - strcpy(data_file, ""); - if (srcdir) - { - strcpy(data_file, srcdir); - strcat(data_file, "/"); - } - strcat(data_file,fname); - - /* ensure the given palette is valid */ - if (!palette) - return -1; - - /* open the input file */ - if (!(file = fopen(data_file, "r"))) - { - printf( "Could not open file %s. Try set $srcdir \n", data_file ); - return -1; - } - - /* read the file ident string */ - if (fgets(buffer, sizeof(buffer), file) == NULL) - { - fclose(file); - return -1; - } - - /* ensure it matches the palette file ident string */ - if ( strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && - strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0 ) - { - fclose(file); - return -1; - } - - /* read the version string */ - if (fgets(buffer, sizeof(buffer), file) == NULL) - { - fclose(file); - return -1; - } - - /* ensure it matches the palette file version string */ - if ( strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && - strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0 ) - { - fclose(file); - return -1; - } - - /* read the number of colors */ - if (fgets(buffer, sizeof(buffer), file) == NULL) - { - fclose(file); - return -1; - } - - - /* extract the number of colors. + /*------------------------------------------------------------------------- + * compose the name of the file to open, using "srcdir", if appropriate + *------------------------------------------------------------------------- + */ + strcpy(data_file, ""); + if (srcdir) + { + strcpy(data_file, srcdir); + strcat(data_file, "/"); + } + strcat(data_file,fname); + + /* ensure the given palette is valid */ + if (!palette) + return -1; + + /* open the input file */ + if (!(file = fopen(data_file, "r"))) + { + printf( "Could not open file %s. Try set $srcdir \n", data_file ); + return -1; + } + + /* read the file ident string */ + if (fgets(buffer, sizeof(buffer), file) == NULL) + { + fclose(file); + return -1; + } + + /* ensure it matches the palette file ident string */ + if ( strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && + strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0 ) + { + fclose(file); + return -1; + } + + /* read the version string */ + if (fgets(buffer, sizeof(buffer), file) == NULL) + { + fclose(file); + return -1; + } + + /* ensure it matches the palette file version string */ + if ( strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && + strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0 ) + { + fclose(file); + return -1; + } + + /* read the number of colors */ + if (fgets(buffer, sizeof(buffer), file) == NULL) + { + fclose(file); + return -1; + } + + + /* extract the number of colors. check for missing version or number of colors in this case it reads the first entry */ - if ( strlen( buffer ) > 4 ) - { - fclose(file); - return -1; - } - - if (sscanf(buffer, "%u", &nentries) != 1) - { - fclose(file); - return -1; - } - - /* ensure there are a sensible number of colors in the palette */ - if ((nentries > 256) || (nentries > palette_size)) - { - fclose(file); - return(-1); - } - - /* read the palette entries */ - for (u = 0; u < nentries; u++) - { - /* extract the red, green and blue color components. */ - if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) - { - fclose(file); - return -1; - } - /* store this palette entry */ - palette[u].r = (unsigned char)red; - palette[u].g = (unsigned char)green; - palette[u].b = (unsigned char)blue; - } - - /* close file */ - fclose(file); - - return nentries; + if ( strlen( buffer ) > 4 ) + { + fclose(file); + return -1; + } + + if (sscanf(buffer, "%u", &nentries) != 1) + { + fclose(file); + return -1; + } + + /* ensure there are a sensible number of colors in the palette */ + if ((nentries > 256) || (nentries > palette_size)) + { + fclose(file); + return(-1); + } + + /* read the palette entries */ + for (u = 0; u < nentries; u++) + { + /* extract the red, green and blue color components. */ + if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) + { + fclose(file); + return -1; + } + /* store this palette entry */ + palette[u].r = (unsigned char)red; + palette[u].g = (unsigned char)green; + palette[u].b = (unsigned char)blue; + } + + /* close file */ + fclose(file); + + return nentries; } diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 239ad60..6de2e31 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -45,358 +45,355 @@ #define ATTR10_NAME "attr float" #define ATTR11_NAME "attr double" -/*Initial input buffer size for testing H5LTtext_to_dtype()*/ -#define BUF_SIZE 1024 - static herr_t make_attributes( hid_t loc_id, const char* obj_name ); /*------------------------------------------------------------------------- - * test dataset functions - *------------------------------------------------------------------------- - */ +* test dataset functions +*------------------------------------------------------------------------- +*/ static int test_dsets( void ) { - int rank = 2; - hsize_t dims[2] = {2,3}; - hid_t file_id; - hid_t dataset_id; - char data_char_in[DIM] = {1,2,3,4,5,6}; - char data_char_out[DIM]; - short data_short_in[DIM] = {1,2,3,4,5,6}; - short data_short_out[DIM]; - int data_int_in[DIM] = {1,2,3,4,5,6}; - int data_int_out[DIM]; - long data_long_in[DIM] = {1,2,3,4,5,6}; - long data_long_out[DIM]; - float data_float_in[DIM] = {1,2,3,4,5,6}; - float data_float_out[DIM]; - double data_double_in[DIM] = {1,2,3,4,5,6}; - double data_double_out[DIM]; - const char *data_string_in = "This is a string"; - char data_string_out[20]; - int i; - - - /* Create a new file using default properties. */ - file_id = H5Fcreate( FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); + int rank = 2; + hsize_t dims[2] = {2,3}; + hid_t file_id; + hid_t dataset_id; + char data_char_in[DIM] = {1,2,3,4,5,6}; + char data_char_out[DIM]; + short data_short_in[DIM] = {1,2,3,4,5,6}; + short data_short_out[DIM]; + int data_int_in[DIM] = {1,2,3,4,5,6}; + int data_int_out[DIM]; + long data_long_in[DIM] = {1,2,3,4,5,6}; + long data_long_out[DIM]; + float data_float_in[DIM] = {1,2,3,4,5,6}; + float data_float_out[DIM]; + double data_double_in[DIM] = {1,2,3,4,5,6}; + double data_double_out[DIM]; + const char *data_string_in = "This is a string"; + char data_string_out[20]; + int i; -/*------------------------------------------------------------------------- - * H5LTmake_dataset test - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset"); + /* Create a new file using default properties. */ + file_id = H5Fcreate( FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); - /* Make dataset */ - if ( H5LTmake_dataset( file_id, DSET0_NAME, rank, dims, H5T_NATIVE_INT, data_int_in ) < 0 ) - goto out; + /*------------------------------------------------------------------------- + * H5LTmake_dataset test + *------------------------------------------------------------------------- + */ - /* Read dataset using the basic HDF5 API */ + TESTING("H5LTmake_dataset"); - if ( ( dataset_id = H5Dopen2(file_id, DSET0_NAME, H5P_DEFAULT) ) < 0 ) - goto out; + /* Make dataset */ + if ( H5LTmake_dataset( file_id, DSET0_NAME, rank, dims, H5T_NATIVE_INT, data_int_in ) < 0 ) + goto out; - if ( H5Dread ( dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_int_out ) < 0 ) - goto out; + /* Read dataset using the basic HDF5 API */ - if ( H5Dclose( dataset_id ) < 0 ) - goto out; + if ( ( dataset_id = H5Dopen2(file_id, DSET0_NAME, H5P_DEFAULT) ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_int_in[i] != data_int_out[i] ) { - goto out; - } - } + if ( H5Dread ( dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_int_out ) < 0 ) + goto out; - PASSED(); + if ( H5Dclose( dataset_id ) < 0 ) + goto out; -/*------------------------------------------------------------------------- - * read using the LT function H5LTread_dataset - *------------------------------------------------------------------------- - */ + for (i = 0; i < DIM; i++) + { + if ( data_int_in[i] != data_int_out[i] ) { + goto out; + } + } - TESTING("H5LTread_dataset"); + PASSED(); - if ( H5LTread_dataset( file_id, DSET0_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) - goto out; + /*------------------------------------------------------------------------- + * read using the LT function H5LTread_dataset + *------------------------------------------------------------------------- + */ - for (i = 0; i < DIM; i++) - { - if ( data_int_in[i] != data_int_out[i] ) { - goto out; - } - } + TESTING("H5LTread_dataset"); - PASSED(); + if ( H5LTread_dataset( file_id, DSET0_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) + goto out; -/*------------------------------------------------------------------------- - * test the H5LTmake_dataset_ functions - *------------------------------------------------------------------------- - */ + for (i = 0; i < DIM; i++) + { + if ( data_int_in[i] != data_int_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_char - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * test the H5LTmake_dataset_ functions + *------------------------------------------------------------------------- + */ - TESTING("H5LTmake_dataset_char"); - /* Make dataset char */ - if ( H5LTmake_dataset_char( file_id, DSET1_NAME, rank, dims, data_char_in ) < 0 ) - goto out; + /*------------------------------------------------------------------------- + * H5LTmake_dataset_char + *------------------------------------------------------------------------- + */ - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET1_NAME, H5T_NATIVE_CHAR, data_char_out ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_char"); - for (i = 0; i < DIM; i++) - { - if ( data_char_in[i] != data_char_out[i] ) { - goto out; - } - } + /* Make dataset char */ + if ( H5LTmake_dataset_char( file_id, DSET1_NAME, rank, dims, data_char_in ) < 0 ) + goto out; + + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET1_NAME, H5T_NATIVE_CHAR, data_char_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_char( file_id, DSET1_NAME, data_char_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_char_in[i] != data_char_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_char_in[i] != data_char_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_char( file_id, DSET1_NAME, data_char_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_char_in[i] != data_char_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_short - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_short"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_short + *------------------------------------------------------------------------- + */ - /* Make dataset short */ - if ( H5LTmake_dataset_short( file_id, DSET2_NAME, rank, dims, data_short_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_short"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET2_NAME, H5T_NATIVE_SHORT, data_short_out ) < 0 ) - goto out; + /* Make dataset short */ + if ( H5LTmake_dataset_short( file_id, DSET2_NAME, rank, dims, data_short_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_short_in[i] != data_short_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET2_NAME, H5T_NATIVE_SHORT, data_short_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_short( file_id, DSET2_NAME, data_short_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_short_in[i] != data_short_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_short_in[i] != data_short_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_short( file_id, DSET2_NAME, data_short_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_short_in[i] != data_short_out[i] ) { + goto out; + } + } -/*------------------------------------------------------------------------- - * H5LTmake_dataset_int - *------------------------------------------------------------------------- - */ + PASSED(); - TESTING("H5LTmake_dataset_int"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_int + *------------------------------------------------------------------------- + */ - /* Make dataset int */ - if ( H5LTmake_dataset_int( file_id, DSET3_NAME, rank, dims, data_int_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_int"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET3_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) - goto out; + /* Make dataset int */ + if ( H5LTmake_dataset_int( file_id, DSET3_NAME, rank, dims, data_int_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_int_in[i] != data_int_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET3_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_int( file_id, DSET3_NAME, data_int_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_int_in[i] != data_int_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_int_in[i] != data_int_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_int( file_id, DSET3_NAME, data_int_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_int_in[i] != data_int_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_long - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_long"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_long + *------------------------------------------------------------------------- + */ - /* Make dataset long */ - if ( H5LTmake_dataset_long( file_id, DSET4_NAME, rank, dims, data_long_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_long"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET4_NAME, H5T_NATIVE_LONG, data_long_out ) < 0 ) - goto out; + /* Make dataset long */ + if ( H5LTmake_dataset_long( file_id, DSET4_NAME, rank, dims, data_long_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_long_in[i] != data_long_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET4_NAME, H5T_NATIVE_LONG, data_long_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_long( file_id, DSET4_NAME, data_long_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_long_in[i] != data_long_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_long_in[i] != data_long_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_long( file_id, DSET4_NAME, data_long_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_long_in[i] != data_long_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_float - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_float"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_float + *------------------------------------------------------------------------- + */ - /* Make dataset float */ - if ( H5LTmake_dataset_float( file_id, DSET5_NAME, rank, dims, data_float_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_float"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET5_NAME, H5T_NATIVE_FLOAT, data_float_out ) < 0 ) - goto out; + /* Make dataset float */ + if ( H5LTmake_dataset_float( file_id, DSET5_NAME, rank, dims, data_float_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_float_in[i] != data_float_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET5_NAME, H5T_NATIVE_FLOAT, data_float_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_float( file_id, DSET5_NAME, data_float_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_float_in[i] != data_float_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_float_in[i] != data_float_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_float( file_id, DSET5_NAME, data_float_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_float_in[i] != data_float_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_double - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_double"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_double + *------------------------------------------------------------------------- + */ - /* Make dataset double */ - if ( H5LTmake_dataset_double( file_id, DSET6_NAME, rank, dims, data_double_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_double"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET6_NAME, H5T_NATIVE_DOUBLE, data_double_out ) < 0 ) - goto out; + /* Make dataset double */ + if ( H5LTmake_dataset_double( file_id, DSET6_NAME, rank, dims, data_double_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_double_in[i] != data_double_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET6_NAME, H5T_NATIVE_DOUBLE, data_double_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_double( file_id, DSET6_NAME, data_double_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_double_in[i] != data_double_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_double_in[i] != data_double_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_double( file_id, DSET6_NAME, data_double_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_double_in[i] != data_double_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_string - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_string"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_string + *------------------------------------------------------------------------- + */ - /* Make dataset string */ - if ( H5LTmake_dataset_string(file_id,DSET7_NAME,data_string_in) < 0 ) - goto out; + TESTING("H5LTmake_dataset_string"); - /* Read dataset */ - if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 ) - goto out; + /* Make dataset string */ + if ( H5LTmake_dataset_string(file_id,DSET7_NAME,data_string_in) < 0 ) + goto out; - if ( strcmp(data_string_in,data_string_out) != 0 ) - goto out; + /* Read dataset */ + if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 ) + goto out; + if ( strcmp(data_string_in,data_string_out) != 0 ) + goto out; -/*------------------------------------------------------------------------- - * end tests - *------------------------------------------------------------------------- - */ - /* Close the file. */ - H5Fclose( file_id ); + /*------------------------------------------------------------------------- + * end tests + *------------------------------------------------------------------------- + */ + + /* Close the file. */ + H5Fclose( file_id ); - PASSED(); + PASSED(); - return 0; + return 0; out: - /* Close the file. */ - H5_FAILED(); - return -1; + /* Close the file. */ + H5_FAILED(); + return -1; } /*------------------------------------------------------------------------- - * test attribute functions - *------------------------------------------------------------------------- - */ +* test attribute functions +*------------------------------------------------------------------------- +*/ static int test_attr(void) { @@ -477,575 +474,575 @@ out: } /*------------------------------------------------------------------------- - * make_attributes - *------------------------------------------------------------------------- - */ +* make_attributes +*------------------------------------------------------------------------- +*/ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) { - int rank_out; - hsize_t *dims_out = 0; - H5T_class_t type_class; - size_t type_size; - int i; - - char attr_str_in[] = {"My attribute"}; - char attr_str_out[20]; - char attr_char_in[5] = {1,2,3,4,5}; - char attr_char_out[5]; - short attr_short_in[5] = {1,2,3,4,5}; - short attr_short_out[5]; - int attr_int_in[5] = {1,2,3,4,5}; - int attr_int_out[5]; - long attr_long_in[5] = {1,2,3,4,5}; - long attr_long_out[5]; - float attr_float_in[5] = {1,2,3,4,5}; - float attr_float_out[5]; - double attr_double_in[5] = {1,2,3,4,5}; - double attr_double_out[5]; - unsigned char attr_uchar_in[5] = {1,2,3,4,5}; - unsigned char attr_uchar_out[5]; - unsigned short attr_ushort_in[5] = {1,2,3,4,5}; - unsigned short attr_ushort_out[5]; - unsigned int attr_uint_in[5] = {1,2,3,4,5}; - unsigned int attr_uint_out[5]; - unsigned long attr_ulong_in[5] = {1,2,3,4,5}; - unsigned long attr_ulong_out[5]; + int rank_out; + hsize_t *dims_out = 0; + H5T_class_t type_class; + size_t type_size; + int i; + + char attr_str_in[] = {"My attribute"}; + char attr_str_out[20]; + char attr_char_in[5] = {1,2,3,4,5}; + char attr_char_out[5]; + short attr_short_in[5] = {1,2,3,4,5}; + short attr_short_out[5]; + int attr_int_in[5] = {1,2,3,4,5}; + int attr_int_out[5]; + long attr_long_in[5] = {1,2,3,4,5}; + long attr_long_out[5]; + float attr_float_in[5] = {1,2,3,4,5}; + float attr_float_out[5]; + double attr_double_in[5] = {1,2,3,4,5}; + double attr_double_out[5]; + unsigned char attr_uchar_in[5] = {1,2,3,4,5}; + unsigned char attr_uchar_out[5]; + unsigned short attr_ushort_in[5] = {1,2,3,4,5}; + unsigned short attr_ushort_out[5]; + unsigned int attr_uint_in[5] = {1,2,3,4,5}; + unsigned int attr_uint_out[5]; + unsigned long attr_ulong_in[5] = {1,2,3,4,5}; + unsigned long attr_ulong_out[5]; -/*------------------------------------------------------------------------- - * H5LTset_attribute_string test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_string test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_string"); + TESTING("H5LTset_attribute_string"); - /* Set the attribute */ - if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_string test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_string test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_string"); + TESTING("H5LTget_attribute_string"); - /* Get the attribute */ - if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 ) + return -1; - if ( strcmp( attr_str_in, attr_str_out ) != 0 ) - { - return -1; - } + if ( strcmp( attr_str_in, attr_str_out ) != 0 ) + { + return -1; + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_char test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_char test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_char"); + TESTING("H5LTset_attribute_char"); - /* Set the attribute */ - if ( H5LTset_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_char test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_char test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_char"); + TESTING("H5LTget_attribute_char"); - /* Get the attribute */ - if ( H5LTget_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_char_in[i] != attr_char_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_char_in[i] != attr_char_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR2_NAME, H5T_NATIVE_CHAR, attr_char_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR2_NAME, H5T_NATIVE_CHAR, attr_char_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_char_in[i] != attr_char_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_char_in[i] != attr_char_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_short test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_short test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_short"); + TESTING("H5LTset_attribute_short"); - /* Set the attribute */ - if ( H5LTset_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_short test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_short test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_short"); + TESTING("H5LTget_attribute_short"); - /* Get the attribute */ - if ( H5LTget_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_short_in[i] != attr_short_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_short_in[i] != attr_short_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR3_NAME, H5T_NATIVE_SHORT, attr_short_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR3_NAME, H5T_NATIVE_SHORT, attr_short_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_short_in[i] != attr_short_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_short_in[i] != attr_short_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_int test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_int test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_int"); + TESTING("H5LTset_attribute_int"); - /* Set the attribute */ - if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_int test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_int test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_int"); + TESTING("H5LTget_attribute_int"); - /* Get the attribute */ - if ( H5LTget_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_int_in[i] != attr_int_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_int_in[i] != attr_int_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR4_NAME, H5T_NATIVE_INT, attr_int_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR4_NAME, H5T_NATIVE_INT, attr_int_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_int_in[i] != attr_int_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_int_in[i] != attr_int_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_long test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_long test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_long"); + TESTING("H5LTset_attribute_long"); - /* Set the attribute */ - if ( H5LTset_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_long test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_long test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_long"); + TESTING("H5LTget_attribute_long"); - /* Get the attribute */ - if ( H5LTget_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_long_in[i] != attr_long_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_long_in[i] != attr_long_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR5_NAME, H5T_NATIVE_LONG, attr_long_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR5_NAME, H5T_NATIVE_LONG, attr_long_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_long_in[i] != attr_long_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_long_in[i] != attr_long_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_uchar test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_uchar test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_uchar"); + TESTING("H5LTset_attribute_uchar"); - /* Set the attribute */ - if ( H5LTset_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_uchar test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_uchar test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_uchar"); + TESTING("H5LTget_attribute_uchar"); - /* Get the attribute */ - if ( H5LTget_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_uchar_in[i] != attr_uchar_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_uchar_in[i] != attr_uchar_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR6_NAME, H5T_NATIVE_UCHAR, attr_uchar_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR6_NAME, H5T_NATIVE_UCHAR, attr_uchar_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_uchar_in[i] != attr_uchar_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_uchar_in[i] != attr_uchar_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_ushort test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_ushort test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_ushort"); + TESTING("H5LTset_attribute_ushort"); - /* Set the attribute */ - if ( H5LTset_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_ushort test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_ushort test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_ushort"); + TESTING("H5LTget_attribute_ushort"); - /* Get the attribute */ - if ( H5LTget_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_ushort_in[i] != attr_ushort_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_ushort_in[i] != attr_ushort_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR7_NAME, H5T_NATIVE_USHORT, attr_ushort_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR7_NAME, H5T_NATIVE_USHORT, attr_ushort_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_ushort_in[i] != attr_ushort_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_ushort_in[i] != attr_ushort_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_int test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_int test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_uint"); + TESTING("H5LTset_attribute_uint"); - /* Set the attribute */ - if ( H5LTset_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_int test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_int test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_uint"); + TESTING("H5LTget_attribute_uint"); - /* Get the attribute */ - if ( H5LTget_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_uint_in[i] != attr_uint_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_uint_in[i] != attr_uint_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR8_NAME, H5T_NATIVE_UINT, attr_uint_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR8_NAME, H5T_NATIVE_UINT, attr_uint_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_uint_in[i] != attr_uint_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_uint_in[i] != attr_uint_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_ulong test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_ulong test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_ulong"); + TESTING("H5LTset_attribute_ulong"); - /* Set the attribute */ - if ( H5LTset_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_long test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_long test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_ulong"); + TESTING("H5LTget_attribute_ulong"); - /* Get the attribute */ - if ( H5LTget_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_ulong_in[i] != attr_ulong_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_ulong_in[i] != attr_ulong_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR9_NAME, H5T_NATIVE_ULONG, attr_ulong_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR9_NAME, H5T_NATIVE_ULONG, attr_ulong_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_ulong_in[i] != attr_ulong_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_ulong_in[i] != attr_ulong_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_float test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_float test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_float"); + TESTING("H5LTset_attribute_float"); - /* Set the attribute */ - if ( H5LTset_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_float test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_float test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_float"); + TESTING("H5LTget_attribute_float"); - /* Get the attribute */ - if ( H5LTget_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_float_in[i] != attr_float_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_float_in[i] != attr_float_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR10_NAME, H5T_NATIVE_FLOAT, attr_float_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR10_NAME, H5T_NATIVE_FLOAT, attr_float_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_float_in[i] != attr_float_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_float_in[i] != attr_float_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_double test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_double test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_double"); + TESTING("H5LTset_attribute_double"); - /* Set the attribute */ - if ( H5LTset_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_double test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_double test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_double"); + TESTING("H5LTget_attribute_double"); - /* Get the attribute */ - if ( H5LTget_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_double_in[i] != attr_double_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_double_in[i] != attr_double_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR11_NAME, H5T_NATIVE_DOUBLE, attr_double_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR11_NAME, H5T_NATIVE_DOUBLE, attr_double_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_double_in[i] != attr_double_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_double_in[i] != attr_double_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_ndims test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_ndims test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_ndims"); + TESTING("H5LTget_attribute_ndims"); - if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 ) - return -1; + if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 ) + return -1; - if ( rank_out != 1 ) { - return -1; - } + if ( rank_out != 1 ) { + return -1; + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_info test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_info test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_info"); + TESTING("H5LTget_attribute_info"); - dims_out = malloc( sizeof(hsize_t) * rank_out ); + dims_out = (hsize_t*) malloc( sizeof(hsize_t) * rank_out ); - if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, - &type_size) < 0 ) - return -1; + if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, + &type_size) < 0 ) + return -1; - for (i = 0; i < rank_out; i++) - { - if ( dims_out[i] != 5 ) { - return -1; - } - } + for (i = 0; i < rank_out; i++) + { + if ( dims_out[i] != 5 ) { + return -1; + } + } - if ( type_class != H5T_INTEGER ) { - return -1; - } + if ( type_class != H5T_INTEGER ) { + return -1; + } - if ( dims_out ) - free( dims_out ); + if ( dims_out ) + free( dims_out ); - PASSED(); + PASSED(); - return 0; + return 0; } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_integers(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_integers(). +*------------------------------------------------------------------------- +*/ static int test_integers(void) { hid_t dtype; @@ -1094,9 +1091,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_fps(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_fps(). +*------------------------------------------------------------------------- +*/ static int test_fps(void) { hid_t dtype; @@ -1145,9 +1142,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_strings(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_strings(). +*------------------------------------------------------------------------- +*/ static int test_strings(void) { hid_t dtype; @@ -1231,9 +1228,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_opaques(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_opaques(). +*------------------------------------------------------------------------- +*/ static int test_opaques(void) { hid_t dtype; @@ -1280,9 +1277,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_enums(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_enums(). +*------------------------------------------------------------------------- +*/ static int test_enums(void) { hid_t dtype; @@ -1321,8 +1318,8 @@ static int test_enums(void) if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) goto out; /*if(strcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { - printf("dt=\n%s\n", dt_str); - goto out; + printf("dt=\n%s\n", dt_str); + goto out; }*/ free(dt_str); @@ -1338,9 +1335,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_variables(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_variables(). +*------------------------------------------------------------------------- +*/ static int test_variables(void) { hid_t dtype; @@ -1393,9 +1390,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_arrays(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_arrays(). +*------------------------------------------------------------------------- +*/ static int test_arrays(void) { hid_t dtype; @@ -1431,8 +1428,8 @@ static int test_arrays(void) if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) goto out; /*if(strcmp(dt_str, "H5T_ARRAY { [5][7][13] H5T_ARRAY { [17][19] H5T_COMPOUND { H5T_STD_I8BE \"arr_compound_1\"; H5T_STD_I32BE \"arr_compound_2\"; } } }")) { - printf("dt=\n%s\n", dt_str); - goto out; + printf("dt=\n%s\n", dt_str); + goto out; }*/ free(dt_str); @@ -1448,9 +1445,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_compounds(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_compounds(). +*------------------------------------------------------------------------- +*/ static int test_compounds(void) { hid_t dtype; @@ -1513,9 +1510,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_complicated_compound(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_complicated_compound(). +*------------------------------------------------------------------------- +*/ static int test_complicated_compound(void) { hid_t dtype; @@ -1532,8 +1529,8 @@ static int test_complicated_compound(void) /* compose the name of the file to open, using the srcdir, if appropriate */ if(srcdir) { - strcpy(filename, srcdir); - strcat(filename, "/"); + strcpy(filename, srcdir); + strcat(filename, "/"); } strcat(filename, INPUT_FILE); @@ -1541,14 +1538,14 @@ static int test_complicated_compound(void) fp = fopen(filename, "r"); if(fp == NULL) { - printf( "Could not find file %s. Try set $srcdir \n", filename); - goto out; + printf( "Could not find file %s. Try set $srcdir \n", filename); + goto out; } /* This part reads in the input as a string in a slow manner. GNU C - * Library has convenient function getline() but isn't available on - * all machines. - */ + * Library has convenient function getline() but isn't available on + * all machines. + */ if((line = (char*)calloc(size, sizeof(char)))==NULL) goto out; if(fgets(line, (int)size, fp)==NULL) @@ -1593,9 +1590,9 @@ out: } /*------------------------------------------------------------------------- - * test H5LTtext_to_dtype function - *------------------------------------------------------------------------- - */ +* test H5LTtext_to_dtype function +*------------------------------------------------------------------------- +*/ static int test_text_dtype(void) { TESTING("H5LTtext_to_dtype"); @@ -1634,30 +1631,30 @@ out: } /*------------------------------------------------------------------------- - * the main program - *------------------------------------------------------------------------- - */ +* the main program +*------------------------------------------------------------------------- +*/ int main( void ) { - int nerrors=0; + int nerrors=0; - /* test dataset functions */ - nerrors += test_dsets(); + /* test dataset functions */ + nerrors += test_dsets(); - /* test attribute functions */ - nerrors += test_attr(); + /* test attribute functions */ + nerrors += test_attr(); - /* test text-dtype functions */ - nerrors += test_text_dtype(); + /* test text-dtype functions */ + nerrors += test_text_dtype(); - /* check for errors */ - if (nerrors) - goto error; + /* check for errors */ + if (nerrors) + goto error; - return 0; + return 0; error: - return 1; + return 1; } diff --git a/hl/test/test_table.c b/hl/test/test_table.c index bd8dd79..433d49f 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -24,28 +24,28 @@ /*------------------------------------------------------------------------- - * Table API test - * - * Functions tested: - * - * H5TBmake_table - * H5TBread_table - * H5TBwrite_records - * H5TBread_records - * H5TBappend_records - * H5TBinsert_record - * H5TBdelete_record - * H5TBcombine_tables - * H5TBwrite_fields_name - * H5TBread_fields_name - * H5TBwrite_fields_index - * H5TBinsert_field - * H5TBdelete_field - * H5TBget_table_info - * H5TBget_field_info - * - *------------------------------------------------------------------------- - */ +* Table API test +* +* Functions tested: +* +* H5TBmake_table +* H5TBread_table +* H5TBwrite_records +* H5TBread_records +* H5TBappend_records +* H5TBinsert_record +* H5TBdelete_record +* H5TBcombine_tables +* H5TBwrite_fields_name +* H5TBread_fields_name +* H5TBwrite_fields_index +* H5TBinsert_field +* H5TBdelete_field +* H5TBget_table_info +* H5TBget_field_info +* +*------------------------------------------------------------------------- +*/ #define TITLE "Title" #define NFIELDS 5 @@ -55,9 +55,9 @@ #define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);} /*------------------------------------------------------------------------- - * structure used for all tests, a particle with properties - *------------------------------------------------------------------------- - */ +* structure used for all tests, a particle with properties +*------------------------------------------------------------------------- +*/ typedef struct particle_t { char name[16]; @@ -68,19 +68,9 @@ typedef struct particle_t } particle_t; /*------------------------------------------------------------------------- - * local auxiliary functions - *------------------------------------------------------------------------- - */ - -static hid_t h5file_open(const char *fname, unsigned flags); -static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ); -static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, - particle_t *rbuf, particle_t *wbuf); - -/*------------------------------------------------------------------------- - * a subset of particle_t, with latitude and longitude fields - *------------------------------------------------------------------------- - */ +* a subset of particle_t, with latitude and longitude fields +*------------------------------------------------------------------------- +*/ typedef struct position_t { long longi; @@ -88,9 +78,9 @@ typedef struct position_t } position_t; /*------------------------------------------------------------------------- - * a subset of particle_t, with name and pressure fields - *------------------------------------------------------------------------- - */ +* a subset of particle_t, with name and pressure fields +*------------------------------------------------------------------------- +*/ typedef struct namepressure_t { char name[16]; @@ -98,9 +88,9 @@ typedef struct namepressure_t } namepressure_t; /*------------------------------------------------------------------------- - * an extended particle, used in the insert field test - *------------------------------------------------------------------------- - */ +* an extended particle, used in the insert field test +*------------------------------------------------------------------------- +*/ typedef struct particle2_t { char name[16]; @@ -112,9 +102,9 @@ typedef struct particle2_t } particle2_t; /*------------------------------------------------------------------------- - * a particle with one field less, used in the delete field test - *------------------------------------------------------------------------- - */ +* a particle with one field less, used in the delete field test +*------------------------------------------------------------------------- +*/ typedef struct particle3_t { char name[16]; @@ -126,16 +116,16 @@ typedef struct particle3_t /*------------------------------------------------------------------------- - * function to open an HDF5 file and return its file identifier - *------------------------------------------------------------------------- - */ +* function to open an HDF5 file and return its file identifier +*------------------------------------------------------------------------- +*/ static hid_t h5file_open(const char *fname, unsigned flags) { - + hid_t fid; /* identifier for the file */ char *srcdir = getenv("srcdir"); /* the source directory */ char data_file[512]=""; /* buffer to hold name of existing file */ - + /* compose the name of the file to open, using the srcdir, if appropriate */ if (srcdir) { @@ -143,21 +133,21 @@ static hid_t h5file_open(const char *fname, unsigned flags) strcat(data_file,"/"); } strcat(data_file,fname); - + /* open */ if ((fid = H5Fopen(data_file,flags,H5P_DEFAULT))<0) { fprintf(stderr,"Error: Cannot open file <%s>\n",data_file ); exit(1); } - + return fid; } /*------------------------------------------------------------------------- - * function that compares one particle - *------------------------------------------------------------------------- - */ +* function that compares one particle +*------------------------------------------------------------------------- +*/ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ) { if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || @@ -177,9 +167,9 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ) } /*------------------------------------------------------------------------- - * function to compare deleted records - *------------------------------------------------------------------------- - */ +* function to compare deleted records +*------------------------------------------------------------------------- +*/ static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, particle_t *rbuf, particle_t *wbuf) { @@ -204,11 +194,11 @@ static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, /*------------------------------------------------------------------------- - * the test program - *------------------------------------------------------------------------- - */ +* the test program +*------------------------------------------------------------------------- +*/ -int test_table(hid_t fid, int write) +static int test_table(hid_t fid, int do_write) { hid_t fid1; hid_t fid2; @@ -219,7 +209,7 @@ int test_table(hid_t fid, int write) int fill1_new[1] = { -100 }; hsize_t position; char tname[20]; - int i, j; + hsize_t i, j; /* write, read, append, delete, insert some records and fields */ hsize_t FIELDS = NFIELDS; hsize_t RECORDS = NRECORDS; @@ -277,39 +267,39 @@ int test_table(hid_t fid, int write) {"six", 6.0f}, {"seven", 7.0f}, }; - - + + /*------------------------------------------------------------------------- * initialize table parameters * field offsets and sizes used in the fields functions *------------------------------------------------------------------------- */ - + size_t field_offset_pos[2]= { HOFFSET( position_t, longi ), - HOFFSET( position_t, lati ) + HOFFSET( position_t, lati ) }; size_t field_offset_namepre[2]= { HOFFSET( namepressure_t, name ), - HOFFSET( namepressure_t, pressure ) + HOFFSET( namepressure_t, pressure ) }; size_t field_sizes_pos[2]= { sizeof(position_in[0].longi), - sizeof(position_in[0].lati) + sizeof(position_in[0].lati) }; size_t field_sizes_namepre[2]= { sizeof(namepre_in[0].name), - sizeof(namepre_in[0].pressure) + sizeof(namepre_in[0].pressure) }; size_t field_sizes_pre[1]= { sizeof(namepre_in[0].pressure) }; - + /*------------------------------------------------------------------------- * query table test *------------------------------------------------------------------------- @@ -318,7 +308,7 @@ int test_table(hid_t fid, int write) size_t sizes_out[NFIELDS]; size_t offset_out[NFIELDS]; size_t size_out; - + /*------------------------------------------------------------------------- * initialize table parameters * field indexes (zero based) used in the fields functions @@ -329,7 +319,7 @@ int test_table(hid_t fid, int write) int field_index_pos[2] = { 1,4 }; int field_index_namepre[2] = { 0,2 }; int field_index[NFIELDS] = { 0,1,2,3,4 }; - + /*------------------------------------------------------------------------- * initialize table parameters * size and the offsets of struct members in memory @@ -351,48 +341,48 @@ int test_table(hid_t fid, int write) sizeof( rbuf2[0].temperature), sizeof( rbuf2[0].lati), sizeof( rbuf2[0].new_field)}; - /*------------------------------------------------------------------------- - * initialize table parameters - * size and the offsets of struct members in memory - * these are used for the delete field test - *------------------------------------------------------------------------- + /*------------------------------------------------------------------------- + * initialize table parameters + * size and the offsets of struct members in memory + * these are used for the delete field test + *------------------------------------------------------------------------- */ size_t dst_size3 = sizeof( particle3_t ); size_t dst_offset3[NFIELDS-1] = { HOFFSET( particle3_t, name ), HOFFSET( particle3_t, longi ), HOFFSET( particle3_t, temperature ), HOFFSET( particle3_t, lati )}; - + size_t dst_sizes3[NFIELDS-1] = { sizeof( rbuf3[0].name), sizeof( rbuf3[0].longi), sizeof( rbuf3[0].temperature), sizeof( rbuf3[0].lati)}; - - - /*------------------------------------------------------------------------- - * initialize table parameters - * 1) size and the offsets of struct members in memory - * 2) field names - * 3) define a HDF5 type for the fields - *------------------------------------------------------------------------- + + + /*------------------------------------------------------------------------- + * initialize table parameters + * 1) size and the offsets of struct members in memory + * 2) field names + * 3) define a HDF5 type for the fields + *------------------------------------------------------------------------- */ - + size_t type_size_mem = sizeof( particle_t ); size_t field_offset[NFIELDS]= { HOFFSET( particle_t, name ), - HOFFSET( particle_t, longi ), - HOFFSET( particle_t, pressure ), - HOFFSET( particle_t, temperature ), - HOFFSET( particle_t, lati ) + HOFFSET( particle_t, longi ), + HOFFSET( particle_t, pressure ), + HOFFSET( particle_t, temperature ), + HOFFSET( particle_t, lati ) }; size_t field_size[NFIELDS] = { sizeof( rbuf[0].name), - sizeof( rbuf[0].longi), - sizeof( rbuf[0].pressure), - sizeof( rbuf[0].temperature), - sizeof( rbuf[0].lati) + sizeof( rbuf[0].longi), + sizeof( rbuf[0].pressure), + sizeof( rbuf[0].temperature), + sizeof( rbuf[0].lati) }; const char *field_names[NFIELDS] = { "Name","Longitude","Pressure","Temperature","Latitude" }; @@ -404,7 +394,7 @@ int test_table(hid_t fid, int write) field_type[2] = H5T_NATIVE_FLOAT; field_type[3] = H5T_NATIVE_DOUBLE; field_type[4] = H5T_NATIVE_INT; - + /*------------------------------------------------------------------------- * * Functions tested: @@ -414,37 +404,37 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - if (write) + if (do_write) { TESTING2("making table"); - + if (H5TBmake_table(TITLE,fid,"table1",FIELDS,RECORDS,type_size_mem, field_names,field_offset,field_type, chunk_size,fill,compress,wbuf)<0) goto out; PASSED(); } - + TESTING2("reading table"); - + /*------------------------------------------------------------------------- * read the table *------------------------------------------------------------------------- */ - + if (H5TBread_table(fid,"table1",type_size_mem,field_offset,field_size,rbuf)<0) goto out; - + /* compare the extracted table with the original array */ for( i = 0; i < NRECORDS; i++ ) { if (cmp_par(i,i,rbuf,wbuf)<0) goto out; } - + PASSED(); - - + + /*------------------------------------------------------------------------- * * Functions tested: @@ -453,16 +443,16 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - if (write) + if (do_write) { TESTING2("writing records"); - + /* create an empty table */ if (H5TBmake_table(TITLE,fid,"table2",FIELDS,RECORDS,type_size_mem, field_names,field_offset,field_type, chunk_size,fill,compress,0)<0) goto out; - + /*------------------------------------------------------------------------- * write records, start at 0, write 8 * pos = 0 1 2 3 4 5 6 7 @@ -474,21 +464,21 @@ int test_table(hid_t fid, int write) if (H5TBwrite_records(fid,"table2",wstart,wrecords,type_size_mem,field_offset, field_size,wbuf)<0) goto out; - + /* read it back */ if (H5TBread_table(fid,"table2",type_size_mem,field_offset,field_size,rbuf)<0) goto out; - + /* compare */ for( i = 0; i < NRECORDS; i++ ) { if (cmp_par(i,i,rbuf,wbuf)<0) goto out; } - + PASSED(); } - + /*------------------------------------------------------------------------- * * Functions tested: @@ -497,40 +487,40 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - + TESTING2("reading records"); - + /*------------------------------------------------------------------------- * read records, start at 0, read 8 * pos = 0 1 2 3 4 5 6 7 * data= 0 1 2 3 4 5 6 7 *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * for the read test we cannot use "table2" because it has been appended * we use the original "table1" instead *------------------------------------------------------------------------- */ - if(write) + if(do_write) strcpy(tname,"table2"); else strcpy(tname,"table1"); - + rstart=0; rrecords=8; if (H5TBread_records(fid,tname,rstart,rrecords,type_size_mem,field_offset, field_size,rbuf)<0) goto out; - + /* compare */ - for( i=(int)rstart; i<(int)rrecords; i++) + for( i = rstart; i < rrecords; i++) { if (cmp_par(i,i,rbuf,wbuf)<0) goto out; } PASSED(); - + /*------------------------------------------------------------------------- * * Functions tested: @@ -540,10 +530,10 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - if (write) + if (do_write) { TESTING2("appending records"); - + /*------------------------------------------------------------------------- * append 2 records * pos = 0 1 2 3 4 5 6 7 8 9 @@ -553,30 +543,30 @@ int test_table(hid_t fid, int write) arecords=2; if (H5TBappend_records(fid,"table2",arecords,type_size_mem,field_offset,field_size,abuf)<0) return 1; - + if (H5TBget_table_info(fid,"table2",&rfields,&rrecords)<0) return 1; - + rstart=0; rrecords=NRECORDS+arecords; if (H5TBread_records(fid,"table2",rstart,rrecords,type_size_mem,field_offset, field_size,rbuf)<0) return 1; - + /* compare */ wrecords=8; - for( i=(int)rstart; i<(int)wrecords; i++) + for( i = rstart; i< wrecords; i++) { if (cmp_par(i,i,rbuf,wbuf)<0) goto out; } - for( i=(int)wrecords, j=0; i<(int)rrecords; i++,j++) + for( i = wrecords, j = 0; i < rrecords; i++,j++) { if (cmp_par(i,j,rbuf,abuf)<0) goto out; } PASSED(); } - + /*------------------------------------------------------------------------- * * Functions tested: @@ -586,10 +576,10 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - if (write) + if (do_write) { TESTING2("inserting records"); - + /*------------------------------------------------------------------------- * insert 2 records * pos = 0 1 2 3 4 5 6 7 8 9 10 11 @@ -599,44 +589,44 @@ int test_table(hid_t fid, int write) istart=1; irecords=2; if (H5TBinsert_record(fid,"table2",istart,irecords,type_size_mem,field_offset,field_size,ibuf)<0) return 1; - + if (H5TBget_table_info(fid,"table2",&rfields,&rrecords)<0) return 1; - + if (H5TBread_records(fid,"table2",rstart,rrecords,type_size_mem,field_offset, field_size,rbuf)<0) return 1; - + /* compare */ - for( i=0; i<12; i++) + for( i = 0; i < 12; i++) { - if (i=(int)istart && i<(int)istart+(int)irecords) + else if (i >= istart && i < istart + irecords) { - j=i-(int)istart; + j = i - istart; if (cmp_par(i,j,rbuf,ibuf)<0) goto out; } - else if (i>=(int)istart+(int)irecords && i<10) + else if ( i >= istart + irecords && i < 10 ) { - j=i-(int)irecords; + j = i - irecords; if (cmp_par(i,j,rbuf,wbuf)<0) goto out; } else { - j=i-10; + j = i - 10; if (cmp_par(i,j,rbuf,abuf)<0) goto out; } } PASSED(); } - + /*------------------------------------------------------------------------- * * Functions tested: @@ -646,17 +636,17 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - if (write) + if (do_write) { TESTING2("deleting records"); - + /*------------------------------------------------------------------------- * Create a table * pos = 0 1 2 3 4 5 6 7 * data= 0 1 2 3 4 5 6 7 *------------------------------------------------------------------------- */ - + for( i=0; id_slist_ptr = - H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16); + H5SL_create(H5SL_TYPE_HADDR); if ( aux_ptr->d_slist_ptr == NULL ) { @@ -598,7 +598,7 @@ H5AC_create(const H5F_t *f, } aux_ptr->c_slist_ptr = - H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16); + H5SL_create(H5SL_TYPE_HADDR); if ( aux_ptr->c_slist_ptr == NULL ) { diff --git a/src/H5B.c b/src/H5B.c index c504507..aba62b0 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -2057,7 +2057,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5B_get_info() */ -#ifndef H5_STRICT_FORMAT_CHECKS /*------------------------------------------------------------------------- * Function: H5B_valid @@ -2099,5 +2098,4 @@ H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5B_valid() */ -#endif /* H5_STRICT_FORMAT_CHECKS */ diff --git a/src/H5B2cache.c b/src/H5B2cache.c index c44820a..5ca7ed8 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -275,7 +275,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_t *bt2, unsigned UNUSED * flags_ptr) +H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, + H5B2_t *bt2, unsigned UNUSED * flags_ptr) { H5WB_t *wb = NULL; /* Wrapped buffer for header data */ uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */ diff --git a/src/H5B2test.c b/src/H5B2test.c index f2cf79d..46cd510 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -456,7 +456,7 @@ H5B2_get_node_depth_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, hadd HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "error looking up node info") /* Set return value */ - ret_value = ninfo.depth; + ret_value = (int)ninfo.depth; done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index 2ec2c22..716b608 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -168,9 +168,7 @@ H5_DLL H5B_shared_t *H5B_shared_new(const H5F_t *f, const H5B_class_t *type, H5_DLL herr_t H5B_shared_free(void *_shared); H5_DLL herr_t H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth, const H5B_class_t *type, void *udata); -#ifndef H5_STRICT_FORMAT_CHECKS H5_DLL htri_t H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr); -#endif /* H5_STRICT_FORMAT_CHECKS */ #endif /* _H5Bprivate_H */ diff --git a/src/H5C.c b/src/H5C.c index 1d6e421..16b6d22 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -3046,8 +3046,7 @@ H5C_create(size_t max_cache_size, "memory allocation failed") } - if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16)) - == NULL ) { + if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR)) == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.") } diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index a88df43..ae90627 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -63,9 +63,6 @@ /* Local Macros */ /****************/ -/* Default skip list height for storing list of chunks */ -#define H5D_CHUNK_DEFAULT_SKIPLIST_HEIGHT 8 - /* Macros for iterating over chunks to operate on */ #define H5D_CHUNK_GET_FIRST_NODE(map) (map->use_single ? (H5SL_node_t *)(1) : H5SL_first(map->sel_chunks)) #define H5D_CHUNK_GET_NODE_INFO(map, node) (map->use_single ? map->single_chunk_info : (H5D_chunk_info_t *)H5SL_item(node)) @@ -534,7 +531,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info else { /* Initialize skip list for chunk selections */ if(NULL == dataset->shared->cache.chunk.sel_chunks) { - if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, 0.5, (size_t)H5D_CHUNK_DEFAULT_SKIPLIST_HEIGHT))) + if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for chunk selections") } /* end if */ fm->sel_chunks = dataset->shared->cache.chunk.sel_chunks; diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index bb9f46b..ed73f3c 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -662,6 +662,12 @@ H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") } /* end if */ + /* Do the data transform before the type conversion (since + * transforms must be done in the memory type). */ + if(!type_info->is_xform_noop) + if(H5Z_xform_eval(dxpl_cache->data_xform_prop, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") + /* * Perform datatype conversion. */ @@ -669,11 +675,6 @@ H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf smine_nelmts, (size_t)0, (size_t)0, type_info->tconv_buf, type_info->bkg_buf, io_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") - - /* Do the data transform after the type conversion (since we're using dataset->shared->type). */ - if(!type_info->is_xform_noop) - if(H5Z_xform_eval(dxpl_cache->data_xform_prop, type_info->tconv_buf, smine_nelmts, type_info->dset_type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") } /* end else */ /* diff --git a/src/H5F.c b/src/H5F.c index 921fe27..fc85688 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -893,6 +893,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) f->shared->driver_addr = HADDR_UNDEF; f->shared->accum.loc = HADDR_UNDEF; f->shared->lf = lf; + f->shared->root_addr = HADDR_UNDEF; /* * Copy the file creation and file access property lists into the @@ -1369,7 +1370,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d /* (This must be after the space for the superblock is allocated in * the file, since the superblock must be at offset 0) */ - if(H5G_mkroot(file, dxpl_id, NULL) < 0) + if(H5G_mkroot(file, dxpl_id, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group") /* Write the superblock to the file */ @@ -1379,21 +1380,12 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d if(H5F_super_write(file, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to write file superblock") } else if (1 == shared->nrefs) { - H5G_loc_t root_loc; /*root location */ - H5O_loc_t root_oloc; /*root object location */ - H5G_name_t root_path; /*root group hier. path */ - - /* Set up root location to fill in */ - root_loc.oloc = &root_oloc; - root_loc.path = &root_path; - H5G_loc_reset(&root_loc); - /* Read the superblock if it hasn't been read before. */ - if(H5F_super_read(file, dxpl_id, &root_loc) < 0) + if(H5F_super_read(file, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") /* Open the root group */ - if(H5G_mkroot(file, dxpl_id, &root_loc) < 0) + if(H5G_mkroot(file, dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group") } /* end if */ diff --git a/src/H5FL.c b/src/H5FL.c index 1045658..dca300c 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -52,6 +52,8 @@ static size_t H5FL_arr_glb_mem_lim=4*1024*1024; /* Default to 4MB limit on all a static size_t H5FL_arr_lst_mem_lim=4*65536; /* Default to 256KB limit on each array free list */ static size_t H5FL_blk_glb_mem_lim=16*1024*1024; /* Default to 16MB limit on all block free lists */ static size_t H5FL_blk_lst_mem_lim=1024*1024; /* Default to 1024KB (1MB) limit on each block free list */ +static size_t H5FL_fac_glb_mem_lim=16*1024*1024; /* Default to 16MB limit on all factory free lists */ +static size_t H5FL_fac_lst_mem_lim=1024*1024; /* Default to 1024KB (1MB) limit on each factory free list */ /* A garbage collection node for regular free lists */ typedef struct H5FL_reg_gc_node_t { @@ -98,6 +100,36 @@ typedef struct H5FL_blk_gc_list_t { /* The head of the list of PQs to garbage collect */ static H5FL_blk_gc_list_t H5FL_blk_gc_head={0,NULL}; +/* A garbage collection node for factory free lists */ +typedef struct H5FL_fac_gc_node_t { + H5FL_fac_head_t *list; /* Pointer to the head of the list to garbage collect */ + struct H5FL_fac_gc_node_t *next; /* Pointer to the next node in the list of things to garbage collect */ +} H5FL_fac_gc_node_t; + +/* The garbage collection head for factory free lists */ +typedef struct H5FL_fac_gc_list_t { + size_t mem_freed; /* Amount of free memory on list */ + struct H5FL_fac_gc_node_t *first; /* Pointer to the first node in the list of things to garbage collect */ +} H5FL_fac_gc_list_t; + +/* Data structure to store each block in factory free list */ +typedef struct H5FL_fac_node_t { + struct H5FL_fac_node_t *next; /* Pointer to next block in free list */ +} H5FL_fac_node_t; + +/* Data structure for free list block factory */ +struct H5FL_fac_head_t { + unsigned init; /* Whether the free list has been initialized */ + unsigned allocated; /* Number of blocks allocated */ + unsigned onlist; /* Number of blocks on free list */ + size_t size; /* Size of the blocks in the list */ + H5FL_fac_node_t *list; /* List of free blocks */ + H5FL_fac_gc_node_t *prev_gc; /* Previous garbage collection node in list */ +}; + +/* The head of the list of factory things to garbage collect */ +static H5FL_fac_gc_list_t H5FL_fac_gc_head={0,NULL}; + #ifdef H5FL_TRACK /* Extra headers needed */ @@ -114,14 +146,18 @@ static herr_t H5FL_arr_gc(void); static herr_t H5FL_arr_gc_list(H5FL_arr_head_t *head); static herr_t H5FL_blk_gc(void); static herr_t H5FL_blk_gc_list(H5FL_blk_head_t *head); -static herr_t H5FL_blk_unlink(H5FL_blk_head_t *pq); - -/* Declare a free list to manage the H5FL_fac_head_t struct */ -H5FL_DEFINE(H5FL_fac_head_t); +static herr_t H5FL_fac_gc(void); +static herr_t H5FL_fac_gc_list(H5FL_fac_head_t *head); /* Declare a free list to manage the H5FL_blk_node_t struct */ H5FL_DEFINE(H5FL_blk_node_t); +/* Declare a free list to manage the H5FL_fac_gc_node_t struct */ +H5FL_DEFINE(H5FL_fac_gc_node_t); + +/* Declare a free list to manage the H5FL_fac_head_t struct */ +H5FL_DEFINE(H5FL_fac_head_t); + /*-------------------------------------------------------------------------- NAME @@ -225,15 +261,15 @@ H5FL_reg_init(H5FL_reg_head_t *head) /* Indicate that the free list is initialized */ head->init=1; + /* Make certain that the space allocated is large enough to store a free list pointer (eventually) */ + if(head->sizesize=sizeof(H5FL_reg_node_t); + /* Make certain there's room for tracking information, if any */ #ifdef H5FL_TRACK head->size += sizeof(H5FL_track_t); #endif /* H5FL_TRACK */ - /* Make certain that the space allocated is large enough to store a free list pointer (eventually) */ - if(head->sizesize=sizeof(void *); - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_reg_init() */ @@ -259,11 +295,13 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj) { void *ret_value=NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5FL_reg_free, NULL) + /* NOINIT OK here because this must be called after H5FL_reg_malloc/calloc + * -NAF */ + FUNC_ENTER_NOAPI_NOINIT(H5FL_reg_free) /* Double check parameters */ - assert(head); - assert(obj); + HDassert(head); + HDassert(obj); #ifdef H5FL_TRACK { @@ -294,7 +332,7 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj) #endif /* H5FL_DEBUG */ /* Make certain that the free list is initialized */ - assert(head->init); + HDassert(head->init); /* Link into the free list */ ((H5FL_reg_node_t *)obj)->next=head->list; @@ -302,16 +340,15 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj) /* Point free list at the node freed */ head->list=(H5FL_reg_node_t *)obj; - /* Increment the number of blocks & memory on free list */ + /* Increment the number of blocks on free list */ head->onlist++; - head->list_mem+=head->size; /* Increment the amount of "regular" freed memory globally */ H5FL_reg_gc_head.mem_freed+=head->size; /* Check for exceeding free list memory use limits */ /* First check this particular list */ - if(head->list_mem>H5FL_reg_lst_mem_lim) + if(head->onlist * head->size > H5FL_reg_lst_mem_lim) if(H5FL_reg_gc_list(head)<0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") @@ -348,7 +385,7 @@ H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(H5FL_reg_malloc, NULL) /* Double check parameters */ - assert(head); + HDassert(head); /* Make certain the list is initialized first */ if(!head->init) @@ -365,7 +402,6 @@ H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) /* Decrement the number of blocks & memory on free list */ head->onlist--; - head->list_mem-=head->size; /* Decrement the amount of global "regular" free list memory in use */ H5FL_reg_gc_head.mem_freed-=(head->size); @@ -426,7 +462,7 @@ H5FL_reg_calloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(H5FL_reg_calloc, NULL) /* Double check parameters */ - assert(head); + HDassert(head); /* Allocate the block */ if (NULL==(ret_value = H5FL_reg_malloc(head H5FL_TRACK_INFO_INT))) @@ -476,17 +512,11 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) /* Decrement the count of nodes allocated and free the node */ head->allocated--; - /* Decrement count of free memory on this list */ - head->list_mem-=head->size; - - H5MM_xfree(free_list); + H5MM_free(free_list); free_list = (H5FL_reg_node_t *)tmp; } /* end while */ - /* Double check that all the memory on this list is recycled */ - HDassert(0 == head->list_mem); - /* Indicate no free nodes on the free list */ head->list=NULL; head->onlist=0; @@ -535,7 +565,7 @@ H5FL_reg_gc(void) } /* end while */ /* Double check that all the memory on the free lists is recycled */ - assert(H5FL_reg_gc_head.mem_freed==0); + HDassert(H5FL_reg_gc_head.mem_freed==0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -797,7 +827,7 @@ H5FL_blk_free_block_avail(H5FL_blk_head_t *head, size_t size) FUNC_ENTER_NOAPI(H5FL_blk_free_block_avail, FAIL) /* Double check parameters */ - assert(head); + HDassert(head); /* check if there is a free list for blocks of this size */ /* and if there are any blocks available on the list */ @@ -838,8 +868,8 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(H5FL_blk_malloc, NULL) /* Double check parameters */ - assert(head); - assert(size); + HDassert(head); + HDassert(size); /* Make certain the list is initialized first */ if(!head->init) @@ -928,8 +958,8 @@ H5FL_blk_calloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(H5FL_blk_calloc, NULL) /* Double check parameters */ - assert(head); - assert(size); + HDassert(head); + HDassert(size); /* Allocate the block */ if (NULL==(ret_value = H5FL_blk_malloc(head,size H5FL_TRACK_INFO_INT))) @@ -969,11 +999,13 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block) size_t free_size; /* Size of the block freed */ void *ret_value=NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5FL_blk_free, NULL) + /* NOINIT OK here because this must be called after H5FL_blk_malloc/calloc + * -NAF */ + FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_free) /* Double check parameters */ - assert(head); - assert(block); + HDassert(head); + HDassert(block); #ifdef H5FL_TRACK { @@ -1070,8 +1102,8 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_ FUNC_ENTER_NOAPI(H5FL_blk_realloc, NULL) /* Double check parameters */ - assert(head); - assert(new_size); + HDassert(head); + HDassert(new_size); /* Check if we are actually re-allocating a block */ if(block!=NULL) { @@ -1119,67 +1151,6 @@ done: } /* end H5FL_blk_realloc() */ -/*-------------------------------------------------------------------------- - NAME - H5FL_blk_unlink - PURPOSE - Remove a block free list from the global list of initialized block free - lists. - USAGE - void H5FL_blk_unlink(H5FL_blk_head_t *pq) - H5FL_blk_head_t *pq; IN: Block free list to remove from global list - RETURNS - Success: Non-negative - Failure: Negative - DESCRIPTION - Search through the global list of initialized block free lists and remove - a particular free list. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5FL_blk_unlink(H5FL_blk_head_t *pq) -{ - H5FL_blk_gc_node_t *last; /* Pointer to the last garbage collection node examined */ - H5FL_blk_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_unlink) - - /* Find the node to remove from the global list */ - last=NULL; - tmp=H5FL_blk_gc_head.first; - while(tmp!=NULL) { - /* Check if the list has allocations outstanding */ - if(tmp->pq==pq) { - /* Unlink node from linked list */ - if(last==NULL) - H5FL_blk_gc_head.first=H5FL_blk_gc_head.first->next; - else - last->next=tmp->next; - - /* Free the block node */ - H5MM_xfree(tmp); - - /* Leave now */ - break; - } /* end if */ - - /* Advance to next node in list */ - last=tmp; - tmp=tmp->next; - } /* end while */ - - if(tmp==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't release block free list") - -done: - FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FL_blk_unlink() */ - - /*------------------------------------------------------------------------- * Function: H5FL_blk_gc_list * @@ -1221,7 +1192,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) H5FL_blk_gc_head.mem_freed-=head->head->size; /* Free the block */ - H5MM_xfree(list); + H5MM_free(list); list = (H5FL_blk_list_t *)next; } /* end while */ @@ -1279,7 +1250,7 @@ H5FL_blk_gc(void) } /* end while */ /* Double check that all the memory on the free lists are recycled */ - assert(H5FL_blk_gc_head.mem_freed==0); + HDassert(H5FL_blk_gc_head.mem_freed==0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1334,7 +1305,7 @@ printf("H5FL_blk_term: head->name=%s, head->allocated=%d\n", H5FL_blk_gc_head.fi H5FL_blk_gc_head.first->pq->init=0; /* Free the node from the garbage collection list */ - H5MM_xfree(H5FL_blk_gc_head.first); + H5MM_free(H5FL_blk_gc_head.first); } /* end else */ H5FL_blk_gc_head.first=tmp; @@ -1422,17 +1393,19 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) size_t free_nelem; /* Number of elements in node being free'd */ void *ret_value=NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5FL_arr_free, NULL) + /* NOINIT OK here because this must be called after H5FL_arr_malloc/calloc + * -NAF */ + FUNC_ENTER_NOAPI_NOINIT(H5FL_arr_free) /* The H5MM_xfree code allows obj to null */ if (!obj) HGOTO_DONE (NULL) /* Double check parameters */ - assert(head); + HDassert(head); /* Make certain that the free list is initialized */ - assert(head->init); + HDassert(head->init); /* Get the pointer to the info header in front of the block to free */ temp=(H5FL_arr_list_t *)((unsigned char *)obj-sizeof(H5FL_arr_list_t)); /*lint !e826 Pointer-to-pointer cast is appropriate here */ @@ -1441,7 +1414,7 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) free_nelem=temp->nelem; /* Double-check that there is enough room for arrays of this size */ - assert((int)free_nelem<=head->maxelem); + HDassert((int)free_nelem<=head->maxelem); /* Link into the free list */ temp->next=head->list_arr[free_nelem].list; @@ -1500,8 +1473,8 @@ H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem) FUNC_ENTER_NOAPI(H5FL_arr_malloc, NULL) /* Double check parameters */ - assert(head); - assert(elem); + HDassert(head); + HDassert(elem); /* Make certain the list is initialized first */ if(!head->init) @@ -1509,7 +1482,7 @@ H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem) HGOTO_ERROR (H5E_RESOURCE, H5E_CANTINIT, NULL, "can't initialize 'array' blocks") /* Sanity check that the number of elements is supported */ - assert(elem<=(unsigned) head->maxelem); + HDassert(elem<=(unsigned) head->maxelem); /* Get the set of the memory block */ mem_size=head->list_arr[elem].size; @@ -1573,8 +1546,8 @@ H5FL_arr_calloc(H5FL_arr_head_t *head, size_t elem) FUNC_ENTER_NOAPI(H5FL_arr_calloc, NULL) /* Double check parameters */ - assert(head); - assert(elem); + HDassert(head); + HDassert(elem); /* Allocate the array */ if (NULL==(ret_value = H5FL_arr_malloc(head,elem))) @@ -1611,8 +1584,8 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem) FUNC_ENTER_NOAPI(H5FL_arr_realloc, NULL) /* Double check parameters */ - assert(head); - assert(new_elem); + HDassert(head); + HDassert(new_elem); /* Check if we are really allocating the object */ if(obj==NULL) @@ -1621,7 +1594,7 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem) H5FL_arr_list_t *temp; /* Temp. ptr to the new free list node allocated */ /* Sanity check that the number of elements is supported */ - assert((int)new_elem<=head->maxelem); + HDassert((int)new_elem<=head->maxelem); /* Get the pointer to the info header in front of the block to free */ temp=(H5FL_arr_list_t *)((unsigned char *)obj-sizeof(H5FL_arr_list_t)); /*lint !e826 Pointer-to-pointer cast is appropriate here */ @@ -1687,7 +1660,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) /* Decrement the count of nodes allocated and free the node */ head->allocated--; - H5MM_xfree(arr_free_list); + H5MM_free(arr_free_list); arr_free_list = (H5FL_arr_list_t *)tmp; } /* end while */ @@ -1705,7 +1678,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) } /* end for */ /* Double check that all the memory on this list is recycled */ - assert(head->list_mem==0); + HDassert(head->list_mem==0); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FL_arr_gc_list() */ @@ -1746,7 +1719,7 @@ H5FL_arr_gc(void) } /* end while */ /* Double check that all the memory on the free lists are recycled */ - assert(H5FL_arr_gc_head.mem_freed==0); + HDassert(H5FL_arr_gc_head.mem_freed==0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1803,7 +1776,7 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi H5FL_arr_gc_head.first->list->init=0; /* Free the node from the garbage collection list */ - H5MM_xfree(H5FL_arr_gc_head.first); + H5MM_free(H5FL_arr_gc_head.first); } /* end else */ H5FL_arr_gc_head.first=tmp; @@ -1834,14 +1807,16 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi void * H5FL_seq_free(H5FL_seq_head_t *head, void *obj) { + /* NOINIT OK here because this must be called after H5FL_seq_malloc/calloc + * -NAF */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_seq_free) /* Double check parameters */ - assert(head); - assert(obj); + HDassert(head); + HDassert(obj); /* Make certain that the free list is initialized */ - assert(head->queue.init); + HDassert(head->queue.init); /* Use block routine */ H5FL_blk_free(&(head->queue),obj); @@ -1873,8 +1848,8 @@ H5FL_seq_malloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(H5FL_seq_malloc, NULL) /* Double check parameters */ - assert(head); - assert(elem); + HDassert(head); + HDassert(elem); /* Use block routine */ ret_value=H5FL_blk_malloc(&(head->queue),head->size*elem H5FL_TRACK_INFO_INT); @@ -1907,8 +1882,8 @@ H5FL_seq_calloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(H5FL_seq_calloc, NULL) /* Double check parameters */ - assert(head); - assert(elem); + HDassert(head); + HDassert(elem); /* Use block routine */ ret_value=H5FL_blk_calloc(&(head->queue),head->size*elem H5FL_TRACK_INFO_INT); @@ -1941,8 +1916,8 @@ H5FL_seq_realloc(H5FL_seq_head_t *head, void * obj, size_t new_elem H5FL_TRACK_P FUNC_ENTER_NOAPI(H5FL_seq_realloc, NULL) /* Double check parameters */ - assert(head); - assert(new_elem); + HDassert(head); + HDassert(new_elem); /* Use block routine */ ret_value=H5FL_blk_realloc(&(head->queue),obj,head->size*new_elem H5FL_TRACK_INFO_INT); @@ -1964,14 +1939,18 @@ done: * Wednesday, February 2, 2005 * * Modifications: + * Neil Fortner + * Friday, December 19, 2008 + * Totally rewritten to support new factory implementation * *------------------------------------------------------------------------- */ H5FL_fac_head_t * H5FL_fac_init(size_t size) { - H5FL_fac_head_t *factory; /* Pointer to new block factory */ - H5FL_fac_head_t *ret_value; /* Return value */ + H5FL_fac_gc_node_t *new_node; /* Pointer to the node for the new list to garbage collect */ + H5FL_fac_head_t *factory; /* Pointer to new block factory */ + H5FL_fac_head_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5FL_fac_init, NULL) @@ -1979,15 +1958,38 @@ H5FL_fac_init(size_t size) HDassert(size>0); /* Allocate room for the new factory */ - if(NULL==(factory=H5FL_MALLOC(H5FL_fac_head_t))) + if(NULL == (factory = (H5FL_fac_head_t *)H5FL_CALLOC(H5FL_fac_head_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for factory object") - /* Initialize block header information */ - HDmemset(&(factory->queue),0,sizeof(H5FL_blk_head_t)); - /* Set size of blocks for factory */ factory->size=size; + /* Allocate a new garbage collection node */ + if(NULL == (new_node = (H5FL_fac_gc_node_t *)H5FL_MALLOC(H5FL_fac_gc_node_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + /* Initialize the new garbage collection node */ + new_node->list = factory; + + /* Link in to the garbage collection list */ + new_node->next=H5FL_fac_gc_head.first; + H5FL_fac_gc_head.first=new_node; + if(new_node->next) + new_node->next->list->prev_gc=new_node; + /* The new factory's prev_gc field will be set to NULL */ + + /* Make certain that the space allocated is large enough to store a free list pointer (eventually) */ + if(factory->sizesize=sizeof(H5FL_fac_node_t); + + /* Make certain there's room for tracking information, if any */ +#ifdef H5FL_TRACK + factory->size += sizeof(H5FL_track_t); +#endif /* H5FL_TRACK */ + + /* Indicate that the free list is initialized */ + factory->init=1; + /* Set return value */ ret_value=factory; @@ -2001,32 +2003,86 @@ done: * * Purpose: Release a block back to a factory & put on free list * - * Return: Success: Non-negative - * Failure: Negative + * Return: NULL * * Programmer: Quincey Koziol * Wednesday, February 2, 2005 * * Modifications: + * Neil Fortner + * Friday, December 19, 2008 + * Totally rewritten to support new factory implementation * *------------------------------------------------------------------------- */ void * H5FL_fac_free(H5FL_fac_head_t *head, void *obj) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_fac_free) + void *ret_value=NULL; /* Return value */ + + /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ + FUNC_ENTER_NOAPI_NOINIT(H5FL_fac_free) /* Double check parameters */ - assert(head); - assert(obj); + HDassert(head); + HDassert(obj); + +#ifdef H5FL_TRACK + { + H5FL_track_t *trk = obj = ((unsigned char *)obj) - sizeof(H5FL_track_t); + + /* Free tracking information about the allocation location */ + H5CS_close_stack(trk->stack); + trk->stack = H5MM_xfree(trk->stack); + trk->file = H5MM_xfree(trk->file); + trk->func = H5MM_xfree(trk->func); + + /* Remove from "outstanding allocations" list */ + if(trk == H5FL_out_head_g) { + H5FL_out_head_g = H5FL_out_head_g->next; + if(H5FL_out_head_g) + H5FL_out_head_g->prev = NULL; + } /* end if */ + else { + trk->prev->next = trk->next; + if(trk->next) + trk->next->prev = trk->prev; + } /* end else */ + } +#endif /* H5FL_TRACK */ + +#ifdef H5FL_DEBUG + HDmemset(obj,255,head->size); +#endif /* H5FL_DEBUG */ /* Make certain that the free list is initialized */ - assert(head->queue.init); + HDassert(head->init); - /* Use block routine */ - H5FL_blk_free(&(head->queue),obj); + /* Link into the free list */ + ((H5FL_fac_node_t *)obj)->next=head->list; - FUNC_LEAVE_NOAPI(NULL) + /* Point free list at the node freed */ + head->list=(H5FL_fac_node_t *)obj; + + /* Increment the number of blocks on free list */ + head->onlist++; + + /* Increment the amount of "factory" freed memory globally */ + H5FL_fac_gc_head.mem_freed+=head->size; + + /* Check for exceeding free list memory use limits */ + /* First check this particular list */ + if(head->onlist * head->size > H5FL_fac_lst_mem_lim) + if(H5FL_fac_gc_list(head)<0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") + + /* Then check the global amount memory on factory free lists */ + if(H5FL_fac_gc_head.mem_freed > H5FL_fac_glb_mem_lim) + if(H5FL_fac_gc()<0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") + +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_fac_free() */ @@ -2042,6 +2098,9 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) * Wednesday, February 2, 2005 * * Modifications: + * Neil Fortner + * Friday, December 19, 2008 + * Totally rewritten to support new factory implementation * *------------------------------------------------------------------------- */ @@ -2050,13 +2109,54 @@ H5FL_fac_malloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_fac_malloc, NULL) + /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ + FUNC_ENTER_NOAPI_NOINIT(H5FL_fac_malloc) /* Double check parameters */ - assert(head); + HDassert(head); + HDassert(head->init); - /* Use block routine */ - ret_value=H5FL_blk_malloc(&(head->queue),head->size H5FL_TRACK_INFO_INT); + /* Check for nodes available on the free list first */ + if(head->list!=NULL) { + /* Get a pointer to the block on the free list */ + ret_value=(void *)(head->list); + + /* Remove node from free list */ + head->list=head->list->next; + + /* Decrement the number of blocks & memory on free list */ + head->onlist--; + + /* Decrement the amount of global "factory" free list memory in use */ + H5FL_fac_gc_head.mem_freed-=(head->size); + } /* end if */ + /* Otherwise allocate a node */ + else { + if (NULL==(ret_value = H5FL_malloc(head->size))) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + /* Increment the number of blocks allocated in list */ + head->allocated++; + } /* end else */ + +#ifdef H5FL_TRACK + /* Copy allocation location information */ + ((H5FL_track_t *)ret_value)->stack = H5MM_calloc(sizeof(H5CS_t)); + H5CS_copy_stack(((H5FL_track_t *)ret_value)->stack); + ((H5FL_track_t *)ret_value)->file = H5MM_strdup(call_file); + ((H5FL_track_t *)ret_value)->func = H5MM_strdup(call_func); + ((H5FL_track_t *)ret_value)->line = call_line; + + /* Add to "outstanding allocations" list */ + ((H5FL_track_t *)ret_value)->prev = NULL; + ((H5FL_track_t *)ret_value)->next = H5FL_out_head_g; + if(H5FL_out_head_g) + H5FL_out_head_g->prev = (H5FL_track_t *)ret_value; + H5FL_out_head_g = (H5FL_track_t *)ret_value; + + /* Adjust for allocation tracking information */ + ret_value = ((unsigned char *)ret_value) + sizeof(H5FL_track_t); +#endif /* H5FL_TRACK */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -2075,6 +2175,9 @@ done: * Wednesday, February 2, 2005 * * Modifications: + * Neil Fortner + * Friday, December 19, 2008 + * Totally rewritten to support new factory implementation * *------------------------------------------------------------------------- */ @@ -2083,17 +2186,115 @@ H5FL_fac_calloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_fac_calloc, NULL) + /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ + FUNC_ENTER_NOAPI_NOINIT(H5FL_fac_calloc) /* Double check parameters */ - assert(head); + HDassert(head); - /* Use block routine */ - ret_value=H5FL_blk_calloc(&(head->queue),head->size H5FL_TRACK_INFO_INT); + /* Allocate the block */ + if (NULL==(ret_value = H5FL_fac_malloc(head H5FL_TRACK_INFO_INT))) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + /* Clear to zeros */ + /* (Accomodate tracking information, if present) */ + HDmemset(ret_value,0,head->size - H5FL_TRACK_SIZE); done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_fac_calloc() */ + +/*------------------------------------------------------------------------- + * Function: H5FL_fac_gc_list + * + * Purpose: Garbage collect on a particular factory free list + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Friday, December 19, 2008 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FL_fac_gc_list(H5FL_fac_head_t *head) +{ + H5FL_fac_node_t *free_list; /* Pointer to nodes in free list being garbage collected */ + void *tmp; /* Temporary node pointer */ + size_t total_mem; /* Total memory used on list */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_fac_gc_list) + + /* Calculate the total memory used on this list */ + total_mem=head->onlist*head->size; + + /* For each free list being garbage collected, walk through the nodes and free them */ + free_list=head->list; + while(free_list!=NULL) { + tmp=free_list->next; + + /* Decrement the count of nodes allocated and free the node */ + head->allocated--; + + H5MM_free(free_list); + + free_list = (H5FL_fac_node_t *)tmp; + } /* end while */ + + /* Indicate no free nodes on the free list */ + head->list=NULL; + head->onlist=0; + + /* Decrement global count of free memory on "factory" lists */ + H5FL_fac_gc_head.mem_freed-=total_mem; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FL_fac_gc_list() */ + + +/*------------------------------------------------------------------------- + * Function: H5FL_fac_gc + * + * Purpose: Garbage collect on all the factory free lists + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Friday, December 19, 2008 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FL_fac_gc(void) +{ + H5FL_fac_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ + herr_t ret_value=SUCCEED; /* return value*/ + + FUNC_ENTER_NOAPI_NOINIT(H5FL_fac_gc) + + /* Walk through all the free lists, free()'ing the nodes */ + gc_node=H5FL_fac_gc_head.first; + while(gc_node!=NULL) { + /* Release the free nodes on the list */ + if(H5FL_fac_gc_list(gc_node->list)<0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of list failed") + + /* Go on to the next free list to garbage collect */ + gc_node=gc_node->next; + } /* end while */ + + /* Double check that all the memory on the free lists is recycled */ + HDassert(H5FL_fac_gc_head.mem_freed==0); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FL_fac_gc() */ /*------------------------------------------------------------------------- @@ -2108,29 +2309,50 @@ done: * Wednesday, February 2, 2005 * * Modifications: + * Neil Fortner + * Friday, December 19, 2008 + * Totally rewritten to support new factory implementation * *------------------------------------------------------------------------- */ herr_t H5FL_fac_term(H5FL_fac_head_t *factory) { - herr_t ret_value=SUCCEED; /* Return value */ + H5FL_fac_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ + herr_t ret_value = SUCCEED; /* Return value */ + /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ FUNC_ENTER_NOAPI_NOINIT(H5FL_fac_term) /* Sanity check */ HDassert(factory); /* Garbage collect all the blocks in the factory's free list */ - if(H5FL_blk_gc_list(&(factory->queue))<0) + if(H5FL_fac_gc_list(factory)<0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of factory failed") /* Verify that all the blocks have been freed */ - if(factory->queue.allocated>0) + if(factory->allocated>0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "factory still has objects allocated") /* Unlink block free list for factory from global free list */ - H5FL_blk_unlink(&(factory->queue)); + if(factory->prev_gc) { + H5FL_fac_gc_node_t *last = factory->prev_gc; /* Garbage collection node before the one being removed */ + + HDassert(last->next->list == factory); + tmp = last->next->next; + (void)H5FL_FREE(H5FL_fac_gc_node_t, last->next); + last->next = tmp; + if(tmp) + tmp->list->prev_gc = last; + } else { + HDassert(H5FL_fac_gc_head.first->list == factory); + tmp = H5FL_fac_gc_head.first->next; + (void)H5FL_FREE(H5FL_fac_gc_node_t, H5FL_fac_gc_head.first); + H5FL_fac_gc_head.first = tmp; + if(tmp) + tmp->list->prev_gc = NULL; + } /* end else */ /* Free factory info */ (void)H5FL_FREE(H5FL_fac_head_t, factory); @@ -2141,6 +2363,52 @@ done: /*------------------------------------------------------------------------- + * Function: H5FL_fac_term_all + * + * Purpose: Terminate all block factories + * + * Return: 0. There should never be any outstanding allocations + * when this is called. + * + * Programmer: Neil Fortner + * Friday, December 19, 2008 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +H5FL_fac_term_all(void) +{ + H5FL_fac_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_fac_term_all) + + /* Free the nodes on the garbage collection list */ + while(H5FL_fac_gc_head.first != NULL) { + tmp=H5FL_fac_gc_head.first->next; + +#ifdef H5FL_DEBUG +printf("H5FL_fac_term: head->size=%d, head->allocated=%d\n", (int)H5FL_fac_gc_head.first->list->size,(int)H5FL_fac_gc_head.first->list->allocated); +#endif /* H5FL_DEBUG */ + + /* The list cannot have any allocations outstanding */ + HDassert(H5FL_fac_gc_head.first->list->allocated == 0); + + /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ + H5FL_fac_gc_head.first->list->init = 0; + + /* Free the node from the garbage collection list */ + (void)H5FL_FREE(H5FL_fac_gc_node_t, H5FL_fac_gc_head.first); + + H5FL_fac_gc_head.first = tmp; + } /* end while */ + + FUNC_LEAVE_NOAPI(0) +} /* end H5FL_fac_term_all() */ + + +/*------------------------------------------------------------------------- * Function: H5FL_garbage_coll * * Purpose: Garbage collect on all the free lists @@ -2160,7 +2428,7 @@ H5FL_garbage_coll(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5FL_garbage_coll) + FUNC_ENTER_NOAPI(H5FL_garbage_coll, FAIL) /* Garbage collect the free lists for array objects */ if(H5FL_arr_gc()<0) @@ -2174,6 +2442,10 @@ H5FL_garbage_coll(void) if(H5FL_reg_gc()<0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect regular objects") + /* Garbage collect the free lists for factory objects */ + if(H5FL_fac_gc()<0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect regular objects") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_garbage_coll() */ @@ -2204,13 +2476,16 @@ done: * Programmer: Quincey Koziol * Wednesday, August 2, 2000 * - * Modifications: + * Modifications: Neil Fortner + * Wednesday, April 8, 2009 + * Added support for factory free lists * *------------------------------------------------------------------------- */ herr_t H5FL_set_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) + int arr_list_lim, int blk_global_lim, int blk_list_lim, int fac_global_lim, + int fac_list_lim) { herr_t ret_value = SUCCEED; @@ -2229,6 +2504,10 @@ H5FL_set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_l H5FL_blk_glb_mem_lim=(blk_global_lim==-1 ? UINT_MAX : (size_t)blk_global_lim); /* limit on each block free list */ H5FL_blk_lst_mem_lim=(blk_list_lim==-1 ? UINT_MAX : (size_t)blk_list_lim); + /* limit on all factory free lists */ + H5FL_fac_glb_mem_lim=(fac_global_lim==-1 ? UINT_MAX : (size_t)fac_global_lim); + /* limit on each factory free list */ + H5FL_fac_lst_mem_lim=(fac_list_lim==-1 ? UINT_MAX : (size_t)fac_list_lim); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2264,7 +2543,7 @@ H5FL_term_interface(void) /* Garbage collect any nodes on the free lists */ (void)H5FL_garbage_coll(); - ret_value=H5FL_reg_term()+H5FL_arr_term()+H5FL_blk_term(); + ret_value=H5FL_reg_term()+H5FL_fac_term_all()+H5FL_arr_term()+H5FL_blk_term(); #ifdef H5FL_TRACK /* If we haven't freed all the allocated memory, dump out the list now */ diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index a799dc4..c1a865a 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -100,7 +100,6 @@ typedef struct H5FL_reg_head_t { unsigned init; /* Whether the free list has been initialized */ unsigned allocated; /* Number of blocks allocated */ unsigned onlist; /* Number of blocks on free list */ - size_t list_mem; /* Amount of memory on free list */ const char *name; /* Name of the type */ size_t size; /* Size of the blocks in the list */ H5FL_reg_node_t *list; /* List of free blocks */ @@ -112,7 +111,7 @@ typedef struct H5FL_reg_head_t { #define H5FL_REG_NAME(t) H5_##t##_reg_free_list #ifndef H5_NO_REG_FREE_LISTS /* Common macros for H5FL_DEFINE & H5FL_DEFINE_STATIC */ -#define H5FL_DEFINE_COMMON(t) H5FL_reg_head_t H5FL_REG_NAME(t)={0,0,0,0,#t,sizeof(t),NULL} +#define H5FL_DEFINE_COMMON(t) H5FL_reg_head_t H5FL_REG_NAME(t)={0,0,0,#t,sizeof(t),NULL} /* Declare a free list to manage objects of type 't' */ #define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t) @@ -349,11 +348,8 @@ typedef struct H5FL_seq_head_t { #define H5FL_SEQ_REALLOC(t,obj,new_elem) (t *)H5MM_realloc(obj,(new_elem)*sizeof(t)) #endif /* H5_NO_SEQ_FREE_LISTS */ -/* Data structure for free list block factory */ -typedef struct H5FL_fac_head_t { - H5FL_blk_head_t queue; /* Priority queue of blocks */ - size_t size; /* Size of the blocks managed */ -} H5FL_fac_head_t; +/* Forward declaration of the data structure for free list block factory */ +typedef struct H5FL_fac_head_t H5FL_fac_head_t; /* * Macros for defining & using free list factories @@ -381,30 +377,42 @@ typedef struct H5FL_fac_head_t { /* * Library prototypes. */ + /* Block free lists */ H5_DLL void * H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS); H5_DLL void * H5FL_blk_calloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS); H5_DLL void * H5FL_blk_free(H5FL_blk_head_t *head, void *block); H5_DLL void * H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_PARAMS); H5_DLL htri_t H5FL_blk_free_block_avail(H5FL_blk_head_t *head, size_t size); + +/* Regular free lists */ H5_DLL void * H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS); H5_DLL void * H5FL_reg_calloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS); H5_DLL void * H5FL_reg_free(H5FL_reg_head_t *head, void *obj); + +/* Array free lists */ H5_DLL void * H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem); H5_DLL void * H5FL_arr_calloc(H5FL_arr_head_t *head, size_t elem); H5_DLL void * H5FL_arr_free(H5FL_arr_head_t *head, void *obj); H5_DLL void * H5FL_arr_realloc(H5FL_arr_head_t *head, void *obj, size_t new_elem); + +/* Sequence free lists */ H5_DLL void * H5FL_seq_malloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS); H5_DLL void * H5FL_seq_calloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS); H5_DLL void * H5FL_seq_free(H5FL_seq_head_t *head, void *obj); H5_DLL void * H5FL_seq_realloc(H5FL_seq_head_t *head, void *obj, size_t new_elem H5FL_TRACK_PARAMS); + +/* Factory free lists */ H5_DLL H5FL_fac_head_t *H5FL_fac_init(size_t size); H5_DLL void * H5FL_fac_malloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS); H5_DLL void * H5FL_fac_calloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS); H5_DLL void * H5FL_fac_free(H5FL_fac_head_t *head, void *obj); H5_DLL herr_t H5FL_fac_term(H5FL_fac_head_t *head); + +/* General free list routines */ H5_DLL herr_t H5FL_garbage_coll(void); H5_DLL herr_t H5FL_set_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); + int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim, + int fac_global_lim, int fac_list_lim); H5_DLL int H5FL_term_interface(void); #endif diff --git a/src/H5FO.c b/src/H5FO.c index fe3eaa9..33241f0 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -82,7 +82,7 @@ H5FO_create(const H5F_t *f) assert(f->shared); /* Create container used to store open object info */ - if((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16)) == NULL) + if((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR)) == NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to create open object container") done: @@ -400,7 +400,7 @@ H5FO_top_create(H5F_t *f) HDassert(f); /* Create container used to store open object info */ - if((f->obj_count = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16)) == NULL) + if((f->obj_count = H5SL_create(H5SL_TYPE_HADDR)) == NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to create open object container") done: diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 42c0f86..77e6d1a 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -45,9 +45,6 @@ /* Default starting size of section buffer */ #define H5FS_SINFO_SIZE_DEFAULT 64 -/* Max. height of the skip list holding free list nodes */ -#define H5FS_DEFAULT_SKIPLIST_HEIGHT 16 - /******************/ /* Local Typedefs */ @@ -962,7 +959,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s bin = H5V_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) { - if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, 0.5, (size_t)H5FS_DEFAULT_SKIPLIST_HEIGHT))) + if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes") } /* end if */ else { @@ -979,7 +976,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s /* Initialize the free list size node */ fspace_node->sect_size = sect->size; fspace_node->serial_count = fspace_node->ghost_count = 0; - if(NULL == (fspace_node->sect_list = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)H5FS_DEFAULT_SKIPLIST_HEIGHT))) + if(NULL == (fspace_node->sect_list = H5SL_create(H5SL_TYPE_HADDR))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes") /* Insert new free space size node into bin's list */ @@ -1058,7 +1055,7 @@ H5FS_sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); #endif /* QAK */ if(fspace->sinfo->merge_list == NULL) - if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)H5FS_DEFAULT_SKIPLIST_HEIGHT))) + if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for merging free space sections") if(H5SL_insert(fspace->sinfo->merge_list, sect, §->addr) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space node into merging skip list") @@ -2101,7 +2098,7 @@ HDfprintf(stderr, "%s: to_mergable = %u\n", FUNC, to_mergable); HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); #endif /* QAK */ if(fspace->sinfo->merge_list == NULL) - if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)H5FS_DEFAULT_SKIPLIST_HEIGHT))) + if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for merging free space sections") if(H5SL_insert(fspace->sinfo->merge_list, sect, §->addr) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space node into merging skip list") diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 4080705..49af73e 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -158,7 +158,8 @@ typedef struct H5F_file_t { int ncwfs; /* Num entries on cwfs list */ struct H5HG_heap_t **cwfs; /* Global heap cache */ struct H5G_t *root_grp; /* Open root group */ - H5G_entry_t *root_ent; /* Root group symbol table entry */ + H5G_entry_t *root_ent; /* Root group symbol table entry */ + haddr_t root_addr; /* Root group address */ H5FO_t *open_objs; /* Open objects in file */ H5RC_t *grp_btree_shared; /* Ref-counted group B-tree node info */ @@ -225,7 +226,7 @@ H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nop /* Superblock related routines */ H5_DLL herr_t H5F_super_init(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5F_super_write(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc); +H5_DLL herr_t H5F_super_read(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5F_super_ext_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_ext_info); /* Metadata accumulator routines */ @@ -247,6 +248,7 @@ H5_DLL herr_t H5F_sfile_remove(H5F_file_t *shared); #ifdef H5F_TESTING H5_DLL herr_t H5F_get_sohm_mesg_count_test(hid_t fid, unsigned type_id, size_t *mesg_count); +H5_DLL herr_t H5F_check_cached_stab_test(hid_t file_id); #endif /* H5F_TESTING */ #endif /* _H5Fpkg_H */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 8040554..32541ae 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -32,6 +32,7 @@ #include "H5FDprivate.h" /* File drivers */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ #include "H5SMprivate.h" /* Shared Object Header Messages */ @@ -230,7 +231,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc) +H5F_super_read(H5F_t *f, hid_t dxpl_id) { uint8_t sbuf[H5F_MAX_SUPERBLOCK_SIZE]; /* Buffer for superblock */ H5P_genplist_t *c_plist; /* File creation property list */ @@ -383,8 +384,9 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc) H5F_addr_decode(f, (const uint8_t **)&p, &shared->extension_addr/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &shared->driver_addr/*out*/); - if(H5G_obj_ent_decode(f, (const uint8_t **)&p, root_loc->oloc/*out*/, - &shared->root_ent/*out*/) < 0) + + /* Decode the symbol table entry */ + if(H5G_root_ent_decode(f, (const uint8_t **)&p) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read root symbol entry") /* @@ -468,7 +470,6 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc) } /* end if */ } /* end if */ else { - haddr_t root_addr; /* Address of root group */ uint32_t computed_chksum; /* Computed checksum */ uint32_t read_chksum; /* Checksum read from file */ @@ -499,7 +500,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc) H5F_addr_decode(f, (const uint8_t **)&p, &shared->base_addr/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &shared->extension_addr/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &root_addr/*out*/); + H5F_addr_decode(f, (const uint8_t **)&p, &shared->root_addr/*out*/); /* Compute checksum for superblock */ computed_chksum = H5_checksum_metadata(sbuf, (size_t)(p - sbuf), 0); @@ -511,11 +512,6 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc) if(read_chksum != computed_chksum) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "bad checksum on driver information block") - /* Create root group object location */ - H5O_loc_reset(root_loc->oloc); - root_loc->oloc->file = f; - root_loc->oloc->addr = root_addr; - /* * Check if superblock address is different from base address and * adjust base address and "end of address" address if so. @@ -930,7 +926,9 @@ H5F_super_write(H5F_t *f, hid_t dxpl_id) rel_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER); H5F_addr_encode(f, &p, (rel_eoa + f->shared->base_addr)); H5F_addr_encode(f, &p, f->shared->driver_addr); - if(H5G_obj_ent_encode(f, &p, H5G_oloc(f->shared->root_grp)) < 0) + + /* Encode the root group object entry, including the cached stab info */ + if(H5G_root_ent_encode(f, &p) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode root group information") /* Encode the driver information block. */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 1d7e514..8cbc133 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -32,6 +32,8 @@ #define H5F_TESTING /*suppress warning about H5F testing funcs*/ #define H5SM_PACKAGE /*suppress error about including H5SMpkg */ #define H5SM_TESTING /*suppress warning about H5SM testing funcs*/ +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5G_TESTING /*suppress warning about H5G testing funcs*/ /***********/ @@ -40,6 +42,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ +#include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5SMpkg.h" /* Shared object header messages */ @@ -113,3 +116,40 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_sohm_mesg_count_test() */ + +/*------------------------------------------------------------------------- + * Function: H5F_check_cached_stab_test + * + * Purpose: Check that a file's superblock contains a cached symbol + * table entry, that the entry matches that in the root + * group's object header, and check that the addresses are + * valid. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Mar 31, 2009 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_check_cached_stab_test(hid_t file_id) +{ + H5F_t *file; /* File info */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5F_check_cached_stab_test) + + /* Check arguments */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") + + /* Verify the cached stab info */ + if(H5G_verify_cached_stab_test(H5G_oloc(file->shared->root_grp), file->shared->root_ent) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_check_cached_stab_test() */ + diff --git a/src/H5G.c b/src/H5G.c index 042ce90..2afd837 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -817,141 +817,6 @@ H5G_term_interface(void) /*------------------------------------------------------------------------- - * Function: H5G_mkroot - * - * Purpose: Creates a root group in an empty file and opens it. If a - * root group is already open then this function immediately - * returns. If ENT is non-null then it's the symbol table - * entry for an existing group which will be opened as the root - * group. Otherwise a new root group is created and then - * opened. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 11 1997 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_mkroot(H5F_t *f, hid_t dxpl_id, H5G_loc_t *loc) -{ - H5O_loc_t new_root_oloc; /* New root object location */ - H5G_name_t new_root_path; /* New root path */ - H5G_loc_t new_root_loc; /* New root location information */ - H5G_loc_t root_loc; /* Root location information */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_mkroot, FAIL) - - /* check args */ - HDassert(f); - - /* Check if the root group is already initialized */ - if(f->shared->root_grp) - HGOTO_DONE(SUCCEED) - - /* Create information needed for group nodes */ - if(H5G_node_init(f) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group node info") - - /* - * If there is no root object then create one. The root group always starts - * with a hard link count of one since it's pointed to by the superblock. - */ - if(loc == NULL) { - H5P_genplist_t *fc_plist; /* File creation property list */ - H5O_ginfo_t ginfo; /* Group info parameters */ - H5O_linfo_t linfo; /* Link info parameters */ - - /* Get the file creation property list */ - /* (Which is a sub-class of the group creation property class) */ - if(NULL == (fc_plist = (H5P_genplist_t *)H5I_object(f->shared->fcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - - /* Get the group info property */ - if(H5P_get(fc_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get group info") - - /* Get the link info property */ - if(H5P_get(fc_plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get link info") - - /* Set up group location for root group */ - new_root_loc.oloc = &new_root_oloc; - new_root_loc.path = &new_root_path; - H5G_loc_reset(&new_root_loc); - loc = &new_root_loc; - - /* Create root group */ - if(H5G_obj_create(f, dxpl_id, &ginfo, &linfo, f->shared->fcpl_id, loc->oloc/*out*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") - if(1 != H5O_link(loc->oloc, 1, dxpl_id)) - HGOTO_ERROR(H5E_SYM, H5E_LINKCOUNT, FAIL, "internal error (wrong link count)") - } /* end if */ - else { - /* - * Open the root object as a group. - */ - if(H5O_open(loc->oloc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open root group") - -#ifndef H5_STRICT_FORMAT_CHECKS - /* If symbol table information is cached, check if we should replace the - * symbol table message with the cached symbol table information */ - if((H5F_INTENT(f) & H5F_ACC_RDWR) && f->shared->root_ent - && (f->shared->root_ent->type == H5G_CACHED_STAB)) { - H5O_stab_t cached_stab; - - /* Retrieve the cached symbol table information */ - cached_stab.btree_addr = f->shared->root_ent->cache.stab.btree_addr; - cached_stab.heap_addr = f->shared->root_ent->cache.stab.heap_addr; - - /* Check if the symbol table message is valid, and replace with the - * cached symbol table if necessary */ - if(H5G_stab_valid(loc->oloc, dxpl_id, &cached_stab) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to verify symbol table") - } /* end if */ -#endif /* H5_STRICT_FORMAT_CHECKS */ - } /* end else */ - - /* Create the path names for the root group's entry */ - H5G_name_init(loc->path, "/"); - - /* - * Create the group pointer. Also decrement the open object count so we - * don't count the root group as an open object. The root group will - * never be closed. - */ - if(NULL == (f->shared->root_grp = H5FL_CALLOC(H5G_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - if(NULL == (f->shared->root_grp->shared = H5FL_CALLOC(H5G_shared_t))) { - (void)H5FL_FREE(H5G_t, f->shared->root_grp); - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - } /* end if */ - - /* Shallow copy (take ownership) of the group object info */ - root_loc.oloc = &(f->shared->root_grp->oloc); - root_loc.path = &(f->shared->root_grp->path); - if(H5G_loc_copy(&root_loc, loc, H5_COPY_SHALLOW) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "can't copy group object location") - - f->shared->root_grp->shared->fo_count = 1; - /* The only other open object should be the superblock extension, if it - * exists. Don't count either the superblock extension or the root group - * in the number of open objects in the file. - */ - HDassert((1 == f->nopen_objs) || - (2 == f->nopen_objs && HADDR_UNDEF != f->shared->extension_addr)); - f->nopen_objs--; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_mkroot() */ - - -/*------------------------------------------------------------------------- * Function: H5G_create * * Purpose: Creates a new empty group with the specified name. The name @@ -1351,36 +1216,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_rootof - * - * Purpose: Return a pointer to the root group of the file. If the file - * is part of a virtual file then the root group of the virtual - * file is returned. - * - * Return: Success: Ptr to the root group of the file. Do not - * free the pointer -- it points directly into - * the file struct. - * - * Failure: NULL - * - * Programmer: Robb Matzke - * Tuesday, October 13, 1998 - * - *------------------------------------------------------------------------- - */ -H5G_t * -H5G_rootof(H5F_t *f) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_rootof) - - while(f->parent) - f = f->parent; - - FUNC_LEAVE_NOAPI(f->shared->root_grp) -} /* end H5G_rootof() */ - - -/*------------------------------------------------------------------------- * Function: H5G_oloc * * Purpose: Returns a pointer to the object location for a group. @@ -1975,7 +1810,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, udata.curr_path_len = 0; /* Create skip list to store visited object information */ - if((udata.visited = H5SL_create(H5SL_TYPE_OBJ, 0.5, (size_t)16)) == NULL) + if((udata.visited = H5SL_create(H5SL_TYPE_OBJ)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create skip list for visited objects") /* Get the group's reference count and type */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 2eb1924..08a9268 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -221,115 +221,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_obj_ent_decode - * - * Purpose: Decodes a symbol table entry into a object location - * - * Return: Success: Non-negative with *pp pointing to the first byte - * following the symbol table entry. - * - * Failure: Negative - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Sep 26 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_obj_ent_decode(H5F_t *f, const uint8_t **pp, H5O_loc_t *oloc, H5G_entry_t **entp) -{ - const uint8_t *p_ret = *pp; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_obj_ent_decode, FAIL) - - /* check arguments */ - HDassert(f); - HDassert(pp); - HDassert(oloc); - - if(entp) { - /* If entp is not NULL we allocate space for the symbol table entry and - * decode the entire entry. */ - if(!(*entp)) /* Only allocate space if *entp is NULL */ - if(NULL == (*entp = (H5G_entry_t *) H5MM_calloc(sizeof(H5G_entry_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate space for symbol table entry") - if(H5G_ent_decode_vec(f, pp, *entp, 1) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode symbol table entry") - - /* Set oloc to the correct values */ - oloc->file = (*entp)->file; - oloc->addr = (*entp)->header; - } else { - /* Set file pointer for root object location */ - oloc->file = f; - - /* decode header */ - *pp += H5F_SIZEOF_SIZE(f); /* Skip over local heap address */ - H5F_addr_decode(f, pp, &(oloc->addr)); - *pp += 4; /* Skip over "cache type" */ - *pp += 4; /* Reserved */ - } - - /* Common oloc settings */ - oloc->holding_file = FALSE; - - /* Set decode pointer */ - *pp = p_ret + H5G_SIZEOF_ENTRY(f); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_ent_decode() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_obj_ent_encode - * - * Purpose: Encodes the specified object location into a symbol table - * entry in the buffer pointed to by *pp. - * - * Return: Success: Non-negative, with *pp pointing to the first byte - * after the symbol table entry. - * - * Failure: Negative - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Sep 26 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_obj_ent_encode(const H5F_t *f, uint8_t **pp, const H5O_loc_t *oloc) -{ - uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY(f); - - FUNC_ENTER_NOAPI_NOFUNC(H5G_obj_ent_encode) - - /* check arguments */ - HDassert(f); - HDassert(pp); - - /* encode header */ - H5F_ENCODE_LENGTH(f, *pp, 0); /* No name for root group */ - if(oloc) - H5F_addr_encode(f, pp, oloc->addr); - else - H5F_addr_encode(f, pp, HADDR_UNDEF); - UINT32ENCODE(*pp, H5G_NOTHING_CACHED); - UINT32ENCODE(*pp, 0); /*reserved*/ - - /* fill with zero */ - while(*pp < p_ret) - *(*pp)++ = 0; - *pp = p_ret; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_obj_ent_encode() */ - - -/*------------------------------------------------------------------------- * Function: H5G_obj_get_linfo * * Purpose: Retrieves the "link info" message for an object. Also diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 38c7628..0840ee7 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -340,6 +340,12 @@ H5_DLLVAR const H5B2_class_t H5G_BT2_NAME[1]; /* The v2 B-tree class for indexing 'creation order' field on links */ H5_DLLVAR const H5B2_class_t H5G_BT2_CORDER[1]; +/* Free list for managing H5G_t structs */ +H5FL_EXTERN(H5G_t); + +/* Free list for managing H5G_shared_t structs */ +H5FL_EXTERN(H5G_shared_t); + /******************************/ /* Package Private Prototypes */ /******************************/ @@ -565,6 +571,7 @@ H5_DLL htri_t H5G_is_new_dense_test(hid_t gid); H5_DLL herr_t H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count); H5_DLL herr_t H5G_lheap_size_test(hid_t gid, size_t *lheap_size); H5_DLL herr_t H5G_user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsigned *user_path_hidden); +H5_DLL herr_t H5G_verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent); #endif /* H5G_TESTING */ #endif /* _H5Gpkg_H */ diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index b1db96f..7f001e0 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -151,7 +151,7 @@ typedef struct H5G_entry_t H5G_entry_t; * Library prototypes... These are the ones that other packages routinely * call. */ -H5_DLL herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc); +H5_DLL herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root); H5_DLL struct H5O_loc_t *H5G_oloc(H5G_t *grp); H5_DLL H5G_t *H5G_rootof(H5F_t *f); H5_DLL H5G_name_t * H5G_nameof(H5G_t *grp); @@ -181,10 +181,8 @@ H5_DLL herr_t H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream /* * These functions operate on group object locations. */ -H5_DLL herr_t H5G_obj_ent_decode(H5F_t *f, const uint8_t **pp, - struct H5O_loc_t *oloc, H5G_entry_t **entp); -H5_DLL herr_t H5G_obj_ent_encode(const H5F_t *f, uint8_t **pp, - const struct H5O_loc_t *oloc); +H5_DLL herr_t H5G_root_ent_decode(H5F_t *f, const uint8_t **pp); +H5_DLL herr_t H5G_root_ent_encode(H5F_t *f, uint8_t **pp); /* * These functions operate on group hierarchy names. diff --git a/src/H5Groot.c b/src/H5Groot.c new file mode 100644 index 0000000..b8a1468 --- /dev/null +++ b/src/H5Groot.c @@ -0,0 +1,368 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /*------------------------------------------------------------------------- + * + * Created: H5Gobj.c + * Apr 8 2009 + * Neil Fortner + * + * Purpose: Functions for operating on the root group. + * + *------------------------------------------------------------------------- + */ + +/****************/ +/* Module Setup */ +/****************/ + +#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property Lists */ + + + +/*------------------------------------------------------------------------- + * Function: H5G_rootof + * + * Purpose: Return a pointer to the root group of the file. If the file + * is part of a virtual file then the root group of the virtual + * file is returned. + * + * Return: Success: Ptr to the root group of the file. Do not + * free the pointer -- it points directly into + * the file struct. + * + * Failure: NULL + * + * Programmer: Robb Matzke + * Tuesday, October 13, 1998 + * + *------------------------------------------------------------------------- + */ +H5G_t * +H5G_rootof(H5F_t *f) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_rootof) + + while(f->parent) + f = f->parent; + + FUNC_LEAVE_NOAPI(f->shared->root_grp) +} /* end H5G_rootof() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_root_ent_decode + * + * Purpose: Decodes the root group symbol table entry into the file + * structure, and updates the root group address in the file + * structure. + * + * Return: Success: Non-negative with *pp pointing to the first byte + * following the symbol table entry. + * + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Sep 26 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_root_ent_decode(H5F_t *f, const uint8_t **pp) +{ + const uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY(f); + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5G_root_ent_decode, FAIL) + + /* check arguments */ + HDassert(f); + HDassert(pp); + + /* Allocate space for the root group symbol table entry */ + HDassert(!f->shared->root_ent); + if(NULL == (f->shared->root_ent = (H5G_entry_t *) H5MM_calloc(sizeof(H5G_entry_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate space for symbol table entry") + + /* decode the root group symbol table entry */ + if(H5G_ent_decode_vec(f, pp, f->shared->root_ent, 1) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode symbol table entry") + + /* Set the root group address to the correct value */ + f->shared->root_addr = f->shared->root_ent->header; + + /* Set decode pointer */ + *pp = p_ret; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_root_ent_decode() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_root_ent_encode + * + * Purpose: Encodes the root group symbol table entry into the buffer + * pointed to by *pp. + * + * Return: Success: Non-negative, with *pp pointing to the first byte + * after the symbol table entry. + * + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Sep 26 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_root_ent_encode(H5F_t *f, uint8_t **pp) +{ + uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY(f); + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5G_root_ent_encode, FAIL) + + /* check arguments */ + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->root_ent); + HDassert(pp); + + /* Encode entry */ + if(H5G_ent_encode_vec(f, pp, f->shared->root_ent, 1) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't encode symbol table entry") + + /* Set encode pointer */ + *pp = p_ret; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_root_ent_encode() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_mkroot + * + * Purpose: Creates a root group in an empty file and opens it. If a + * root group is already open then this function immediately + * returns. If ENT is non-null then it's the symbol table + * entry for an existing group which will be opened as the root + * group. Otherwise a new root group is created and then + * opened. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Aug 11 1997 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) +{ + H5G_loc_t root_loc; /* Root location information */ + htri_t stab_exists = -1; /* Whether the symbol table exists */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5G_mkroot, FAIL) + + /* check args */ + HDassert(f); + + /* Check if the root group is already initialized */ + if(f->shared->root_grp) + HGOTO_DONE(SUCCEED) + + /* Create information needed for group nodes */ + if(H5G_node_init(f) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group node info") + + /* + * Create the group pointer + */ + if(NULL == (f->shared->root_grp = H5FL_CALLOC(H5G_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + if(NULL == (f->shared->root_grp->shared = H5FL_CALLOC(H5G_shared_t))) { + (void)H5FL_FREE(H5G_t, f->shared->root_grp); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + } /* end if */ + + /* Initialize the root_loc structure to point to fields in the newly created + * f->shared->root_grp structure */ + root_loc.oloc = &(f->shared->root_grp->oloc); + root_loc.path = &(f->shared->root_grp->path); + H5G_loc_reset(&root_loc); + + /* + * If there is no root object then create one. The root group always starts + * with a hard link count of one since it's pointed to by the superblock. + */ + if(create_root) { + H5P_genplist_t *fc_plist; /* File creation property list */ + H5O_ginfo_t ginfo; /* Group info parameters */ + H5O_linfo_t linfo; /* Link info parameters */ + unsigned super_vers; /* Superblock version */ + + /* Get the file creation property list */ + /* (Which is a sub-class of the group creation property class) */ + if(NULL == (fc_plist = (H5P_genplist_t *)H5I_object(f->shared->fcpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") + + /* Get the group info property */ + if(H5P_get(fc_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get group info") + + /* Get the link info property */ + if(H5P_get(fc_plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get link info") + + /* Get the superblock version */ + if(H5P_get(fc_plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get superblock version") + + /* Create root group */ + if(H5G_obj_create(f, dxpl_id, &ginfo, &linfo, f->shared->fcpl_id, root_loc.oloc/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") + if(1 != H5O_link(root_loc.oloc, 1, dxpl_id)) + HGOTO_ERROR(H5E_SYM, H5E_LINKCOUNT, FAIL, "internal error (wrong link count)") + + /* Create the root group symbol table entry */ + HDassert(!f->shared->root_ent); + if(super_vers < HDF5_SUPERBLOCK_VERSION_2) { + /* Allocate space for the root group symbol table entry */ + if(NULL == (f->shared->root_ent = (H5G_entry_t *) H5MM_calloc(sizeof(H5G_entry_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate space for symbol table entry") + + /* Initialize the root group symbol table entry */ + f->shared->root_ent->dirty = TRUE; + f->shared->root_ent->type = H5G_NOTHING_CACHED; /* We will cache the stab later */ + f->shared->root_ent->name_off = 0; /* No name (yet) */ + f->shared->root_ent->header = root_loc.oloc->addr; + f->shared->root_ent->file = root_loc.oloc->file; + } /* end if */ + } /* end if */ + else { + /* Create root group object location from f */ + root_loc.oloc->addr = f->shared->root_addr; + root_loc.oloc->file = f; + + /* + * Open the root object as a group. + */ + if(H5O_open(root_loc.oloc) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open root group") + + /* Actions to take if the symbol table information is cached */ + if(f->shared->root_ent && f->shared->root_ent->type == H5G_CACHED_STAB) { + /* Check for the situation where the symbol table is cached but does + * not exist. This can happen if, for example, an external link is + * added to the root group. */ + if((stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check if symbol table message exists") + + /* Remove the cache if the stab does not exist */ + if(!stab_exists) + f->shared->root_ent->type = H5G_NOTHING_CACHED; +#ifndef H5_STRICT_FORMAT_CHECKS + /* If symbol table information is cached, check if we should replace the + * symbol table message with the cached symbol table information */ + else if(H5F_INTENT(f) & H5F_ACC_RDWR) { + H5O_stab_t cached_stab; + + /* Retrieve the cached symbol table information */ + cached_stab.btree_addr = f->shared->root_ent->cache.stab.btree_addr; + cached_stab.heap_addr = f->shared->root_ent->cache.stab.heap_addr; + + /* Check if the symbol table message is valid, and replace with the + * cached symbol table if necessary */ + if(H5G_stab_valid(root_loc.oloc, dxpl_id, &cached_stab) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to verify symbol table") + } /* end if */ +#endif /* H5_STRICT_FORMAT_CHECKS */ + } /* end if */ + } /* end else */ + + /* Cache the root group's symbol table information in the root group symbol + * table entry. It will have been allocated by now if it needs to be + * present, so we don't need to check the superblock version. We do this if + * we have write access, the root entry has been allocated (i.e. + * super_vers < 2) and the stab info is not already cached. */ + if((H5F_INTENT(f) & H5F_ACC_RDWR) && stab_exists != FALSE && f->shared->root_ent + && f->shared->root_ent->type != H5G_CACHED_STAB) { + H5O_stab_t stab; /* Symbol table */ + + /* Check if the stab message exists. It's possible for the root group + * to use the latest version while the superblock is an old version. + * If stab_exists is not -1 then we have already checked. */ + if(stab_exists == -1 && (stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check if symbol table message exists") + + if(stab_exists) { + /* Read the root group's symbol table message */ + if(NULL == H5O_msg_read(root_loc.oloc, H5O_STAB_ID, &stab, dxpl_id)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message") + + /* Update the root group symbol table entry */ + f->shared->root_ent->type = H5G_CACHED_STAB; + f->shared->root_ent->cache.stab.btree_addr = stab.btree_addr; + f->shared->root_ent->cache.stab.heap_addr = stab.heap_addr; + } /* end if */ + } /* end if */ + + /* Create the path names for the root group's entry */ + H5G_name_init(root_loc.path, "/"); + + f->shared->root_grp->shared->fo_count = 1; + /* The only other open object should be the superblock extension, if it + * exists. Don't count either the superblock extension or the root group + * in the number of open objects in the file. + */ + HDassert((1 == f->nopen_objs) || + (2 == f->nopen_objs && HADDR_UNDEF != f->shared->extension_addr)); + f->nopen_objs--; + +done: + /* In case of error, free various memory locations that may have been + * allocated */ + if(ret_value < 0) { + if(f->shared->root_grp) { + if(f->shared->root_grp->shared) + f->shared->root_grp->shared = H5FL_FREE(H5G_shared_t, f->shared->root_grp->shared); + f->shared->root_grp = H5FL_FREE(H5G_t, f->shared->root_grp); + } /* end if */ + f->shared->root_ent = (H5G_entry_t *) H5MM_xfree(f->shared->root_ent); + H5G_name_free(root_loc.path); + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_mkroot() */ + diff --git a/src/H5Gstab.c b/src/H5Gstab.c index c2df8e7..52c9d07 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -1011,7 +1011,8 @@ H5G_stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) FUNC_ENTER_NOAPI(H5G_stab_valid, FAIL) /* Read the symbol table message */ - H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id); + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message"); /* Check if the symbol table message's b-tree address is valid */ if(H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr) < 0) { diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 1f09048..f3508eb 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -550,3 +550,59 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5G_user_path_test() */ + +/*------------------------------------------------------------------------- + * Function: H5G_verify_cached_stab_test + * + * Purpose: Check that a that the provided group entry contains a + * cached symbol table entry, that the entry matches that in + * the provided group's object header, and check that the + * addresses are valid. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Mar 31, 2009 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) +{ + H5O_stab_t stab; /* Symbol table */ + H5HL_t *heap = NULL; /* Pointer to local heap */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5G_verify_cached_stab_test) + + /* Verify that stab info is cached in ent */ + if(ent->type != H5G_CACHED_STAB) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "symbol table information is not cached") + + /* Read the symbol table message from the group */ + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, H5AC_ind_dxpl_id)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message") + + /* Verify that the cached symbol table info matches the symbol table message + * in the object header */ + if((ent->cache.stab.btree_addr != stab.btree_addr) + || (ent->cache.stab.heap_addr != stab.heap_addr)) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "cached stab info does not match object header") + + /* Verify that the btree address is valid */ + if(H5B_valid(grp_oloc->file, H5AC_ind_dxpl_id, H5B_SNODE, stab.btree_addr) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "b-tree address is invalid") + + /* Verify that the heap address is valid */ + if(NULL == (heap = H5HL_protect(grp_oloc->file, H5AC_ind_dxpl_id, stab.heap_addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "heap address is invalid") + +done: + /* Release resources */ + if(heap && H5HL_unprotect(grp_oloc->file, H5AC_ind_dxpl_id, heap, stab.heap_addr) < 0) + HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_verify_cached_stab_test() */ + diff --git a/src/H5I.c b/src/H5I.c index c6fcb17..841b491 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -1847,40 +1847,35 @@ done: /*------------------------------------------------------------------------- * Function: H5Iis_valid * - * Purpose: Check if the given id is valid. And id is valid if it is in - * use and has an application reference count of at least 1. + * Purpose: Check if the given id is valid. An id is valid if it is in + * use and has an application reference count of at least 1. * - * Return: Success: TRUE if the id is valid, FALSE otherwise. + * Return: Success: TRUE if the id is valid, FALSE otherwise. * - * Failure: Negative (never fails currently) + * Failure: Negative (never fails currently) * * Programmer: Neil Fortner * Friday, October 31, 2008 (boo) * + * Modifications: + * Raymond Lu + * 1 April 2009 (Believe it or not!) + * Moved the argument check down to H5I_find_id because other + * caller functions may pass in some invalid IDs to H5I_find_id. + * It used to do assertion check. *------------------------------------------------------------------------- */ htri_t H5Iis_valid(hid_t id) { - H5I_id_type_t *type_ptr; /* ptr to ID's type */ H5I_id_info_t *id_ptr; /* ptr to the ID */ - H5I_type_t type; /* ID's type */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_API(H5Iis_valid, FAIL) H5TRACE1("t", "i", id); - type = H5I_TYPE(id); - /* Check for conditions that would cause H5I_find_id to throw an assertion */ - if (type <= H5I_BADID || type >= H5I_next_type) - HGOTO_DONE(FALSE); - - type_ptr = H5I_id_type_list_g[type]; - if (!type_ptr || type_ptr->count <= 0) - ret_value = FALSE; - /* Find the ID */ - else if (NULL == (id_ptr = H5I_find_id(id))) + if (NULL == (id_ptr = H5I_find_id(id))) ret_value = FALSE; /* Check if the found id is an internal id */ @@ -2012,7 +2007,9 @@ done: * Programmer: * * Modifications: - * + * Raymond Lu + * 1 April 2009 (Believe it or not!) + * Added argument check, took away assertion check. *------------------------------------------------------------------------- */ static H5I_id_info_t * @@ -2029,10 +2026,12 @@ H5I_find_id(hid_t id) /* Check arguments */ type = H5I_TYPE(id); - HDassert(type > H5I_BADID && type < H5I_next_type); - type_ptr = H5I_id_type_list_g[type]; + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_DONE(NULL); - HDassert(type_ptr && type_ptr->count > 0); + type_ptr = H5I_id_type_list_g[type]; + if (!type_ptr || type_ptr->count <= 0) + HGOTO_DONE(NULL); /* Get the bucket in which the ID is located */ hash_loc = (unsigned)H5I_LOC(id, type_ptr->hash_size); @@ -2057,6 +2056,7 @@ H5I_find_id(hid_t id) /* Set the return value */ ret_value = id_ptr; +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_find_id() */ diff --git a/src/H5L.c b/src/H5L.c index 368272b..0de2e10 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -82,6 +82,7 @@ typedef struct { const char *dst_name; /* Destination name for moving object */ H5T_cset_t cset; /* Char set for new name */ H5G_loc_t *dst_loc; /* Destination location for moving object */ + unsigned dst_target_flags; /* Target flags for destination object */ hbool_t copy; /* TRUE if this is a copy operation */ hid_t lapl_id; /* LAPL to use in callback */ hid_t dxpl_id; /* DXPL to use in callback */ @@ -285,6 +286,9 @@ H5L_term_interface(void) H5L_table_g = (H5L_class_t *)H5MM_xfree(H5L_table_g); H5L_table_used_g = H5L_table_alloc_g = 0; + /* Mark the interface as uninitialized */ + H5_interface_initialize_g = 0; + FUNC_LEAVE_NOAPI(n) } /* H5L_term_interface() */ @@ -557,6 +561,8 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!link_name || !*link_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified") + if(link_type < H5L_TYPE_UD_MIN || link_type > H5L_TYPE_MAX) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class") /* Create external link */ if(H5L_create_ud(&link_loc, link_name, udata, udata_size, link_type, lcpl_id, lapl_id, H5AC_dxpl_id) < 0) @@ -2528,7 +2534,8 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, orig_name = H5MM_xstrdup(name); /* Insert the link into its new location */ - if(H5G_traverse(udata->dst_loc, udata->dst_name, H5G_TARGET_NORMAL, H5L_move_dest_cb, &udata_out, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G_traverse(udata->dst_loc, udata->dst_name, udata->dst_target_flags, + H5L_move_dest_cb, &udata_out, udata->lapl_id, udata->dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to follow symbolic link") /* If this is a move and not a copy operation, change the object's name and remove the old link */ @@ -2614,7 +2621,7 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) { - unsigned target_flags = H5G_TARGET_MOUNT|H5G_TARGET_SLINK|H5G_TARGET_UDLINK; + unsigned dst_target_flags = H5G_TARGET_NORMAL; H5T_cset_t char_encoding = H5F_DEFAULT_CSET; /* Character encoding for link */ H5P_genplist_t* lc_plist; /* Link creation property list */ H5P_genplist_t* la_plist; /* Link access property list */ @@ -2641,8 +2648,9 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, if(H5P_get(lc_plist, H5L_CRT_INTERMEDIATE_GROUP_NAME, &crt_intmd_group) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for creating missing groups") + /* Set target flags for source and destination */ if(crt_intmd_group > 0) - target_flags |= H5G_CRT_INTMD_GROUP; + dst_target_flags |= H5G_CRT_INTMD_GROUP; /* Get character encoding property */ if(H5P_get(lc_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &char_encoding) < 0) @@ -2664,13 +2672,15 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, /* Set up user data */ udata.dst_loc = dst_loc; udata.dst_name= dst_name; + udata.dst_target_flags = dst_target_flags; udata.cset = char_encoding; udata.copy = copy_flag; udata.lapl_id = lapl_copy; udata.dxpl_id = dxpl_id; /* Do the move */ - if(H5G_traverse(src_loc, src_name, target_flags, H5L_move_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(src_loc, src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK, + H5L_move_cb, &udata, lapl_id, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to find link") done: diff --git a/src/H5O.c b/src/H5O.c index 9b9d0ef..85fda74 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -2879,7 +2879,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, udata.op_data = op_data; /* Create skip list to store visited object information */ - if((udata.visited = H5SL_create(H5SL_TYPE_OBJ, 0.5, (size_t)16)) == NULL) + if((udata.visited = H5SL_create(H5SL_TYPE_OBJ)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create skip list for visited objects") /* If its ref count is > 1, we add it to the list of visited objects */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 7b76f3d..2926c6b 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -913,7 +913,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, cpy_info.preserve_null = TRUE; /* Create a skip list to keep track of which objects are copied */ - if((cpy_info.map_list = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16)) == NULL) + if((cpy_info.map_list = H5SL_create(H5SL_TYPE_HADDR)) == NULL) HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list") /* copy the object from the source file to the destination file */ diff --git a/src/H5Opline.c b/src/H5Opline.c index 20a9d26..070ab87 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -273,7 +273,7 @@ H5O_pline_encode(H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg) name = NULL; } /* end if */ else { - H5Z_class_t *cls; /* Filter class */ + H5Z_class2_t *cls; /* Filter class */ /* * Get the filter name. If the pipeline message has a name in it then @@ -453,7 +453,7 @@ H5O_pline_size(const H5F_t UNUSED *f, const void *mesg) if(pline->version > H5O_PLINE_VERSION_1 && pline->filter[i].id < H5Z_FILTER_RESERVED) name_len = 0; else { - H5Z_class_t *cls; /* Filter class */ + H5Z_class2_t *cls; /* Filter class */ /* Get the name of the filter, same as done with H5O_pline_encode() */ if(NULL == (name = pline->filter[i].name) && (cls = H5Z_find(pline->filter[i].id))) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index a4d036d..db66366 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -154,7 +154,7 @@ done: * property list. Each of thhese values can be individually unset * (or not set at all) by passing the macros: * H5D_CHUNK_CACHE_NCHUNKS_DEFAULT, - * H5D_CHUNK_CACHE_NBYTES_DEFAULT, and/or + * H5D_CHUNK_CACHE_NSLOTS_DEFAULT, and/or * H5D_CHUNK_CACHE_W0_DEFAULT * as appropriate. * diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index b2bd71d..853e45d 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1574,7 +1574,7 @@ H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/, /* If there's no name on the filter, use the class's filter name */ if(!s) { - H5Z_class_t *cls = H5Z_find(filter->id); + H5Z_class2_t *cls = H5Z_find(filter->id); if(cls) s = cls->name; diff --git a/src/H5Pint.c b/src/H5Pint.c index 799535f..56f1929 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -42,8 +42,6 @@ /* Local Macros */ /****************/ -#define H5P_DEFAULT_SKIPLIST_HEIGHT 8 - /******************/ /* Local Typedefs */ @@ -652,11 +650,11 @@ H5P_copy_plist(H5P_genplist_t *old_plist, hbool_t app_ref) new_plist->class_init = 0; /* Initially, wait until the class callback finishes to set */ /* Initialize the skip list to hold the changed properties */ - if((new_plist->props = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) + if((new_plist->props = H5SL_create(H5SL_TYPE_STR)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for changed properties"); /* Create the skip list for deleted properties */ - if((new_plist->del = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) + if((new_plist->del = H5SL_create(H5SL_TYPE_STR)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for deleted properties"); /* Create the skip list to hold names of properties already seen @@ -664,7 +662,7 @@ H5P_copy_plist(H5P_genplist_t *old_plist, hbool_t app_ref) * 'create' callback called, if a property in the class hierarchy has * already been seen) */ - if((seen = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT))== NULL) + if((seen = H5SL_create(H5SL_TYPE_STR))== NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties"); nseen = 0; @@ -1462,7 +1460,7 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, unsigned internal, pclass->revision = H5P_GET_NEXT_REV; /* Get a revision number for the class */ /* Create the skip list for properties */ - if((pclass->props = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) + if((pclass->props = H5SL_create(H5SL_TYPE_STR)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for properties"); /* Set callback functions and pass-along data */ @@ -1544,11 +1542,11 @@ H5P_create(H5P_genclass_t *pclass) plist->class_init = 0; /* Initially, wait until the class callback finishes to set */ /* Create the skip list for changed properties */ - if((plist->props = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) + if((plist->props = H5SL_create(H5SL_TYPE_STR)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for changed properties"); /* Create the skip list for deleted properties */ - if((plist->del = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) + if((plist->del = H5SL_create(H5SL_TYPE_STR)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for deleted properties"); /* Create the skip list to hold names of properties already seen @@ -1556,7 +1554,7 @@ H5P_create(H5P_genclass_t *pclass) * 'create' callback called, if a property in the class hierarchy has * already been seen) */ - if((seen = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) + if((seen = H5SL_create(H5SL_TYPE_STR)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for seen properties"); /* @@ -3147,7 +3145,7 @@ H5P_iterate_plist(hid_t plist_id, int *idx, H5P_iterate_t iter_func, void *iter_ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Create the skip list to hold names of properties already seen */ - if((seen = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) + if((seen = H5SL_create(H5SL_TYPE_STR)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties"); /* Walk through the changed properties in the list */ @@ -4071,7 +4069,7 @@ H5P_close(void *_plist) * 'close' callback called, if a property in the class hierarchy has * already been seen) */ - if((seen = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) + if((seen = H5SL_create(H5SL_TYPE_STR)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties"); nseen = 0; diff --git a/src/H5SL.c b/src/H5SL.c index fe810d1..31e81c2 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -16,17 +16,34 @@ /* * Purpose: Provides a skip list abstract data type. * + * (See "Deterministic Skip Lists" by Munro, Papadakis & Sedgewick) + * + * (Implementation changed to a deterministic skip list from a + * probabilistic one. This implementation uses a 1-2-3 skip list + * using arrays, as described by Munro, Papadakis & Sedgewick. + * + * Arrays are allocated using a free list factory for each size + * that is a power of two. Factories are created as soon as they + * are needed, and are never destroyed until the package is shut + * down. There is no longer a maximum level or "p" value. + * -NAF 2008/11/05) + * * (See "Skip Lists: A Probabilistic Alternative to Balanced Trees" * by William Pugh for additional information) * * (This implementation has the optimization for reducing key * key comparisons mentioned in section 3.5 of "A Skip List - * Cookbook" by William Pugh) + * Cookbook" by William Pugh + * -Removed as our implementation of this was useless for a 1-2-3 + * skip list. The implementation in that document hurts + * performance, at least for integer keys. -NAF) * * (Also, this implementation has a couple of home-grown * optimizations, including setting the "update" vector to the * actual 'forward' pointer to update, instead of the node - * containing the forward pointer -QAK) + * containing the forward pointer -QAK + * -No longer uses update vector, as insertions/deletions are now + * always at level 0. -NAF) * * (Note: This implementation does not have the information for * implementing the "Linear List Operations" (like insert/delete/ @@ -36,9 +53,6 @@ * (This implementation has an additional backward pointer, which * allows the list to be iterated in reverse) * - * (We should also look into "Deterministic Skip Lists" (see - * paper by Munro, Papadakis & Sedgewick)) - * * (There's also an article on "Alternating Skip Lists", which * are similar to deterministic skip lists, in the August 2000 * issue of Dr. Dobb's Journal) @@ -54,61 +68,28 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5SLprivate.h" /* Skip list routines */ +#include "H5MMprivate.h" /* Memory management */ /* Local Macros */ -/* Define the code template for insertions for the "OP" in the H5SL_LOCATE macro */ -#define H5SL_LOCATE_INSERT_FOUND(SLIST, X, UPDATE, I) \ - HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, NULL, "can't insert duplicate key") - -/* Define the code template for removals for the "OP" in the H5SL_LOCATE macro */ -/* (NOTE: the code in H5SL_remove_first() is largely the same, fix bugs in both places) */ -#define H5SL_LOCATE_REMOVE_FOUND(SLIST,X,UPDATE,I) \ - void *tmp; \ - \ - for(I=0; I<=(int)SLIST->curr_level; I++) { \ - if(*UPDATE[I]!=X) \ - break; \ - *UPDATE[I]=X->forward[I]; \ - } /* end for */ \ - if(SLIST->last==X) \ - SLIST->last=X->backward; \ - else \ - X->forward[0]->backward=X->backward; \ - tmp=X->item; \ - H5FL_ARR_FREE(H5SL_node_ptr_t,X); \ - while(SLIST->curr_level>0 && SLIST->header->forward[SLIST->curr_level]==NULL) \ - SLIST->curr_level--; \ - SLIST->nobjs--; \ - HGOTO_DONE(tmp); - /* Define the code template for searches for the "OP" in the H5SL_LOCATE macro */ -#define H5SL_LOCATE_SEARCH_FOUND(SLIST, X, UPDATE, I) \ +#define H5SL_LOCATE_SEARCH_FOUND(SLIST, X, I) \ HGOTO_DONE(X->item); /* Define the code template for finds for the "OP" in the H5SL_LOCATE macro */ -#define H5SL_LOCATE_FIND_FOUND(SLIST, X, UPDATE, I) \ +#define H5SL_LOCATE_FIND_FOUND(SLIST, X, I) \ HGOTO_DONE(X); -/* Define a code template for "OP"s that update the "update" vector for the H5SL_LOCATE macro */ -#define H5SL_LOCATE_INSERT_UPDATE(X, UPDATE, I) \ - UPDATE[I] = &X->forward[I]; -#define H5SL_LOCATE_REMOVE_UPDATE(X, UPDATE, I) \ - UPDATE[I] = &X->forward[I]; - -/* Define a code template for "OP"s that _DON'T_ update the "update" vector for the H5SL_LOCATE macro */ -#define H5SL_LOCATE_SEARCH_UPDATE(X, UPDATE, I) -#define H5SL_LOCATE_FIND_UPDATE(X, UPDATE, I) - - /* Define a code template for comparing scalar keys for the "CMP" in the H5SL_LOCATE macro */ #define H5SL_LOCATE_SCALAR_CMP(TYPE, PNODE, PKEY, HASHVAL) \ (*(TYPE *)((PNODE)->key) < *(TYPE *)PKEY) /* Define a code template for comparing string keys for the "CMP" in the H5SL_LOCATE macro */ #define H5SL_LOCATE_STRING_CMP(TYPE, PNODE, PKEY, HASHVAL) \ - (((PNODE)->hashval == HASHVAL) ? (HDstrcmp((PNODE)->key, PKEY) < 0) : ((PNODE)->hashval < HASHVAL)) + (((PNODE)->hashval == HASHVAL) ? \ + (HDstrcmp((const char *)(PNODE)->key, (const char *)PKEY) < 0) : \ + ((PNODE)->hashval < HASHVAL)) /* Define a code template for comparing H5_obj_t keys for the "CMP" in the H5SL_LOCATE macro */ #define H5SL_LOCATE_OBJ_CMP(TYPE, PNODE, PKEY, HASHVAL) \ @@ -121,7 +102,7 @@ /* Define a code template for comparing string keys for the "EQ" in the H5SL_LOCATE macro */ #define H5SL_LOCATE_STRING_EQ(TYPE, PNODE, PKEY, HASHVAL) \ - (((PNODE)->hashval == HASHVAL) && (HDstrcmp(((PNODE)->key), PKEY) == 0)) + (((PNODE)->hashval == HASHVAL) && (HDstrcmp((const char *)(PNODE)->key, (const char *)PKEY) == 0)) /* Define a code template for comparing H5_obj_t keys for the "EQ" in the H5SL_LOCATE macro */ #define H5SL_LOCATE_OBJ_EQ(TYPE, PNODE, PKEY, HASHVAL) \ @@ -133,50 +114,358 @@ /* Define a code template for initializing the hash value for string keys for the "HASHINIT" in the H5SL_LOCATE macro */ #define H5SL_LOCATE_STRING_HASHINIT(KEY, HASHVAL) \ - HASHVAL = H5_hash_string(KEY); + HASHVAL = H5_hash_string((const char *)KEY); /* Define a code template for initializing the hash value for H5_obj_t keys for the "HASHINIT" in the H5SL_LOCATE macro */ #define H5SL_LOCATE_OBJ_HASHINIT(KEY, HASHVAL) /* Macro used to find node for operation */ -#define H5SL_LOCATE(OP, CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) \ +#define H5SL_LOCATE(OP, CMP, SLIST, X, TYPE, KEY, HASHVAL) \ { \ - H5SL_node_t *_checked; /* Pointer to last node checked */ \ int _i; /* Local index variable */ \ + unsigned _count; /* Num nodes searched at this height */ \ \ - _checked = NULL; \ H5_GLUE3(H5SL_LOCATE_,CMP,_HASHINIT)(KEY, HASHVAL) \ for(_i = (int)SLIST->curr_level; _i >= 0; _i--) { \ - if(X->forward[_i] != _checked) { \ - while(X->forward[_i] && H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, X->forward[_i], KEY, HASHVAL) ) \ - X = X->forward[_i]; \ - _checked = X->forward[_i]; \ - } /* end if */ \ - H5_GLUE3(H5SL_LOCATE_,OP,_UPDATE)(X, UPDATE, _i) \ + _count = 0; \ + while(_count < 3 && X->forward[_i] && \ + H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, X->forward[_i], KEY, HASHVAL) ) { \ + X = X->forward[_i]; \ + _count++; \ + } /* end while */ \ } /* end for */ \ X = X->forward[0]; \ if(X != NULL && H5_GLUE3(H5SL_LOCATE_,CMP,_EQ)(TYPE, X, KEY, HASHVAL) ) { \ /* What to do when a node is found */ \ - H5_GLUE3(H5SL_LOCATE_,OP,_FOUND)(SLIST, X, UPDATE, _i) \ + H5_GLUE3(H5SL_LOCATE_,OP,_FOUND)(SLIST, X, _i) \ } /* end if */ \ } -/* Macro used to insert node */ -#define H5SL_INSERT(CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) \ - H5SL_LOCATE(INSERT, CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) + +/* Macro used to grow a node by 1. Does not update pointers. LVL is the current + * level of X. Does not update LVL but does update X->lvl. */ +#define H5SL_GROW(X, LVL) \ +{ \ + /* Check if we need to increase allocation of forward pointers */ \ + if(LVL + 1 >= 1u << X->log_nalloc) { \ + H5SL_node_t **_tmp; \ + HDassert(LVL + 1 == 1u << X->log_nalloc); \ + /* Double the amount of allocated space */ \ + X->log_nalloc++; \ + \ + /* Check if we need to create a new factory */ \ + if(X->log_nalloc >= H5SL_fac_nused_g) { \ + HDassert(X->log_nalloc == H5SL_fac_nused_g); \ + \ + /* Check if we need to allocate space for the factory pointer*/ \ + if(H5SL_fac_nused_g >= H5SL_fac_nalloc_g) { \ + HDassert(H5SL_fac_nused_g == H5SL_fac_nalloc_g); \ + /* Double the size of the array of factory pointers */ \ + H5SL_fac_nalloc_g *= 2; \ + H5SL_fac_g = (H5FL_fac_head_t **)H5MM_realloc((void *)H5SL_fac_g, \ + H5SL_fac_nalloc_g * sizeof(H5FL_fac_head_t *)); \ + } /* end if */ \ + \ + /* Create the new factory */ \ + H5SL_fac_g[H5SL_fac_nused_g] = H5FL_fac_init((1u << H5SL_fac_nused_g) * sizeof(H5SL_node_t *)); \ + H5SL_fac_nused_g++; \ + } /* end if */ \ + \ + /* Allocate space for new forward pointers */ \ + if(NULL == (_tmp = (H5SL_node_t **)H5FL_FAC_MALLOC(H5SL_fac_g[X->log_nalloc]))) \ + HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, NULL, "memory allocation failed") \ + HDmemcpy((void *)_tmp, (const void *)X->forward, (LVL + 1) * sizeof(H5SL_node_t *)); \ + (void)H5FL_FAC_FREE(H5SL_fac_g[X->log_nalloc-1], (void *)X->forward); \ + X->forward = _tmp; \ + } /* end if */ \ + \ + X->level++; \ +} + + +/* Macro used to shrink a node by 1. Does not update pointers. LVL is the + * current level of X. Does not update LVL but does update X->level. */ +#define H5SL_SHRINK(X, LVL) \ +{ \ + /* Check if we can reduce the allocation of forward pointers */ \ + if(LVL <= 1u << (X->log_nalloc - 1)) { \ + H5SL_node_t **_tmp; \ + HDassert(LVL == 1u << (X->log_nalloc - 1)); \ + X->log_nalloc--; \ + \ + /* Allocate space for new forward pointers */ \ + if(NULL == (_tmp = (H5SL_node_t **)H5FL_FAC_MALLOC(H5SL_fac_g[X->log_nalloc]))) \ + HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, NULL, "memory allocation failed") \ + HDmemcpy((void *)_tmp, (const void *)X->forward, (LVL) * sizeof(H5SL_node_t *)); \ + (void)H5FL_FAC_FREE(H5SL_fac_g[X->log_nalloc+1], (void *)X->forward); \ + X->forward = _tmp; \ + } /* end if */ \ + \ + X->level--; \ +} + + +/* Macro used to grow the level of a node by 1, with appropriate changes to the + * head node if necessary. PREV is the previous node of the height that X is to + * grow to. */ +#define H5SL_PROMOTE(SLIST, X, PREV) \ +{ \ + size_t _lvl = X->level; \ + \ + H5SL_GROW(X, _lvl); \ + \ + if(_lvl == (size_t) SLIST->curr_level) { \ + HDassert(PREV == SLIST->header); \ + /* Grow the head */ \ + H5SL_GROW(PREV, _lvl); \ + SLIST->curr_level++; \ + X->forward[_lvl+1] = NULL; \ + } else { \ + HDassert(_lvl < (size_t) SLIST->curr_level); \ + X->forward[_lvl+1] = PREV->forward[_lvl+1]; \ + } /* end else */ \ + PREV->forward[_lvl+1] = X; \ +} + + +/* Macro used to reduce the level of a node by 1. Does not update the head node + * "current level". PREV is the previous node of the currrent height of X. */ +#define H5SL_DEMOTE(X, PREV) \ +{ \ + size_t _lvl = X->level; \ + \ + HDassert(PREV->forward[_lvl] == X); \ + PREV->forward[_lvl] = X->forward[_lvl]; \ + H5SL_SHRINK(X, _lvl); \ +} + + +/* Macro used to insert node. Does not actually insert the node. After running + * this macro, X will contain the node before where the new node should be + * inserted (at level 0). */ +#define H5SL_INSERT(CMP, SLIST, X, TYPE, KEY, HASHVAL) \ +{ \ + H5SL_node_t *_last = X; /* Lowest node in the current gap */ \ + H5SL_node_t *_next = NULL; /* Highest node in the currect gap */ \ + H5SL_node_t *_drop; /* Low node of the gap to drop into */ \ + int _count; /* Number of nodes in the current gap */ \ + int _i; \ + \ + H5_GLUE3(H5SL_LOCATE_,CMP,_HASHINIT)(KEY, HASHVAL) \ + for(_i = (int)SLIST->curr_level; _i >= 0; _i--) { \ + /* Search for the node to drop into, also count the number of nodes */ \ + /* of height _i in this gap */ \ + _drop = NULL; \ + for(_count = 0; ; _count++) { \ + /* Terminate if this is the last node in the gap */ \ + if(X->forward[_i] == _next) { \ + if(!_drop) \ + _drop = X; \ + break; \ + } /* end if */ \ + \ + /* Check if this node is the start of the next gap */ \ + if(!_drop && !H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, X->forward[_i], KEY, HASHVAL)) \ + _drop = X; \ + \ + /* No need to check the last node in the gap if there are 3, as */ \ + /* there cannot be a fourth */ \ + if(_count == 2) { \ + if(!_drop) \ + _drop = X->forward[_i]; \ + _count = 3; \ + break; \ + } \ + X = X->forward[_i]; \ + } /* end for */ \ + HDassert(!_drop->forward[_i] || \ + !H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, _drop->forward[_i], KEY, HASHVAL)); \ + \ + /* Promote the middle node if necessary */ \ + if(_count == 3) { \ + HDassert(X == _last->forward[_i]->forward[_i]); \ + H5SL_PROMOTE(SLIST, X, _last) \ + } \ + \ + /* Prepare to drop down */ \ + X = _last = _drop; \ + _next = _drop->forward[_i]; \ + } /* end for */ \ + \ + if(_next && H5_GLUE3(H5SL_LOCATE_,CMP,_EQ)(TYPE, _next, KEY, HASHVAL)) \ + HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, NULL, "can't insert duplicate key") \ +} + /* Macro used to remove node */ -#define H5SL_REMOVE(CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) \ - H5SL_LOCATE(REMOVE, CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) +#define H5SL_REMOVE(CMP, SLIST, X, TYPE, KEY, HASHVAL) \ +{ \ + H5SL_node_t *_last = X; /* Lowest node in the current gap */ \ + H5SL_node_t *_llast = X; /* Lowest node in the previous gap */ \ + H5SL_node_t *_next = NULL; /* Highest node in the currect gap */ \ + H5SL_node_t *_drop = NULL; /* Low node of the gap to drop into */ \ + H5SL_node_t *_ldrop = NULL; /* Low node of gap before the one to drop into */ \ + H5SL_node_t *_head = SLIST->header; /* Head of the skip list */ \ + int _count; /* Number of nodes in the current gap */ \ + int _i = (int)SLIST->curr_level; \ + \ + if(_i < 0) \ + HGOTO_DONE(NULL); \ + \ + H5_GLUE3(H5SL_LOCATE_,CMP,_HASHINIT)(KEY, HASHVAL) \ + \ + /* Find the gap to drop in to at the highest level */ \ + while(X && (!X->key || H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, X, KEY, HASHVAL))) { \ + _llast = _last; \ + _last = X; \ + X = X->forward[_i]; \ + } \ + _next = X; \ + \ + /* Main loop */ \ + for(_i--; _i >= 0; _i--) { \ + /* Search for the node to drop into, also count the number of nodes */ \ + /* of height _i in this gap and keep track of of the node before */ \ + /* the one to drop into (_ldrop will become _llast, _drop will */ \ + /* become _last). */ \ + X = _ldrop = _last; \ + _drop = NULL; \ + for(_count = 0; ; _count++) { \ + /* Terminate if this is the last node in the gap */ \ + if(X->forward[_i] == _next) { \ + if(!_drop) \ + _drop = X; \ + break; \ + } /* end if */ \ + \ + /* If we have already found the node to drop into and there is */ \ + /* more than one node in this gap, we can stop searching */ \ + if(_drop) { \ + HDassert(_count >= 1); \ + _count = 2; \ + break; \ + } else { /* !_drop */ \ + /* Check if this node is the start of the next gap */ \ + if (!H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, X->forward[_i], KEY, HASHVAL)) { \ + _drop = X; \ + /* Again check if we can stop searching */ \ + if(_count) { \ + _count = 2; \ + break; \ + } /* end if */ \ + } /* end if */ \ + else \ + _ldrop = X; \ + } /* end else */ \ + \ + /* No need to check the last node in the gap if there are 3, as */ \ + /* there cannot be a fourth */ \ + if(_count == 2) { \ + if(!_drop) \ + _drop = X->forward[_i]; \ + break; \ + } /* end if */ \ + X = X->forward[_i]; \ + } /* end for */ \ + HDassert(_count >= 1 && _count <= 3); \ + HDassert(!_drop->forward[_i] || \ + !H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, _drop->forward[_i], KEY, HASHVAL)); \ + \ + /* Check if we need to adjust node heights */ \ + if(_count == 1) { \ + /* Check if we are in the first gap */ \ + if(_llast == _last) { \ + /* We are in the first gap, count the number of nodes of */ \ + /* height _i in the next gap. We need only check one node */ \ + /* to see if we should promote the first node in the next */ \ + /* gap */ \ + _llast = _next->forward[_i+1]; \ + \ + /* Demote the separator node */ \ + H5SL_DEMOTE(_next, _last) \ + \ + /* If there are 2 or more nodes, promote the first */ \ + if(_next->forward[_i]->forward[_i] != _llast) { \ + X = _next->forward[_i]; \ + H5SL_PROMOTE(SLIST, X, _last) \ + } else if(!_head->forward[_i+1]) { \ + /* shrink the header */ \ + HDassert(_i == SLIST->curr_level - 1); \ + HDassert((size_t) SLIST->curr_level == _head->level); \ + \ + H5SL_SHRINK(_head, (size_t) (_i+1)) \ + SLIST->curr_level--; \ + } /* end else */ \ + } else { \ + /* We are not in the first gap, count the number of nodes */ \ + /* of height _i in the previous gap. Note we "look ahead" */ \ + /* in this loop so X has the value of the last node in the */ \ + /* previous gap. */ \ + X = _llast->forward[_i]; \ + for(_count = 1; _count < 3 && X->forward[_i] != _last; _count++) \ + X = X->forward[_i]; \ + HDassert(X->forward[_i] == _last); \ + \ + /* Demote the separator node */ \ + H5SL_DEMOTE(_last, _llast) \ + \ + /* If there are 2 or more nodes, promote the last */ \ + if(_count >= 2) \ + H5SL_PROMOTE(SLIST, X, _llast) \ + else if(!_head->forward[_i+1]) { \ + /* shrink the header */ \ + HDassert(_i == SLIST->curr_level - 1); \ + HDassert((size_t) SLIST->curr_level == _head->level); \ + \ + H5SL_SHRINK(_head, (size_t) (_i+1)) \ + SLIST->curr_level--; \ + } /* end else */ \ + } /* end else */ \ + } /* end if */ \ + \ + /* Prepare to drop down */ \ + _llast = _ldrop; \ + _last = _drop; \ + _next = _drop->forward[_i]; \ + } /* end for */ \ + \ + /* Check if we've found the node */ \ + if(_next && H5_GLUE3(H5SL_LOCATE_,CMP,_EQ)(TYPE, _next, KEY, HASHVAL)) { \ + void *tmp = _next->item; \ + X = _next; \ + \ + /* If the node has a height > 0, swap it with its (lower) neighbor */ \ + if(X->level) { \ + X = X->backward; \ + _next->key = X->key; \ + _next->item = X->item; \ + _next->hashval = X->hashval; \ + } /* end if */ \ + HDassert(!X->level); \ + \ + /* Remove the node */ \ + X->backward->forward[0] = X->forward[0]; \ + if(SLIST->last == X) \ + SLIST->last = X->backward; \ + else \ + X->forward[0]->backward = X->backward; \ + SLIST->nobjs--; \ + (void)H5FL_FAC_FREE(H5SL_fac_g[0], X->forward); \ + (void)H5FL_FREE(H5SL_node_t, X); \ + \ + HGOTO_DONE(tmp); \ + } /* end if */ \ +} + /* Macro used to search for node */ -#define H5SL_SEARCH(CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) \ - H5SL_LOCATE(SEARCH, CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) +#define H5SL_SEARCH(CMP, SLIST, X, TYPE, KEY, HASHVAL) \ + H5SL_LOCATE(SEARCH, CMP, SLIST, X, TYPE, KEY, HASHVAL) /* Macro used to find a node */ -#define H5SL_FIND(CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) \ - H5SL_LOCATE(FIND, CMP, SLIST, X, UPDATE, TYPE, KEY, HASHVAL) +#define H5SL_FIND(CMP, SLIST, X, TYPE, KEY, HASHVAL) \ + H5SL_LOCATE(FIND, CMP, SLIST, X, TYPE, KEY, HASHVAL) /* Private typedefs & structs */ @@ -186,6 +475,7 @@ struct H5SL_node_t { const void *key; /* Pointer to node's key */ void *item; /* Pointer to node's item */ size_t level; /* The level of this node */ + size_t log_nalloc; /* log2(Number of slots allocated in forward) */ uint32_t hashval; /* Hash value for key (only for strings, currently) */ struct H5SL_node_t **forward; /* Array of forward pointers from this node */ struct H5SL_node_t *backward; /* Backward pointer from this node */ @@ -195,9 +485,6 @@ struct H5SL_node_t { struct H5SL_t { /* Static values for each list */ H5SL_type_t type; /* Type of skip list */ - double p; /* Probability of using a higher level [0..1) */ - int p1; /* Probability converted into appropriate value for random # generator on this machine */ - size_t max_level; /* Maximum number of levels */ /* Dynamic values for each list */ int curr_level; /* Current top level used in list */ @@ -207,8 +494,7 @@ struct H5SL_t { }; /* Static functions */ -static size_t H5SL_random_level(int p1, size_t max_level); -static H5SL_node_t * H5SL_new_node(size_t lvl, void *item, const void *key, uint32_t hashval); +static H5SL_node_t * H5SL_new_node(void *item, const void *key, uint32_t hashval); static H5SL_node_t *H5SL_insert_common(H5SL_t *slist, void *item, const void *key); static herr_t H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); static herr_t H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); @@ -216,9 +502,13 @@ static herr_t H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data /* Declare a free list to manage the H5SL_t struct */ H5FL_DEFINE_STATIC(H5SL_t); -/* Declare a "base + array" list to manage the H5SL_node_t struct */ -typedef H5SL_node_t *H5SL_node_ptr_t; -H5FL_BARR_DEFINE_STATIC(H5SL_node_t,H5SL_node_ptr_t,H5SL_LEVEL_MAX); +/* Declare a free list to manage the H5SL_node_t struct */ +H5FL_DEFINE_STATIC(H5SL_node_t); + +/* Global variables */ +static H5FL_fac_head_t **H5SL_fac_g; +static size_t H5SL_fac_nused_g; +static size_t H5SL_fac_nalloc_g; /*-------------------------------------------------------------------------- @@ -241,13 +531,15 @@ H5FL_BARR_DEFINE_STATIC(H5SL_node_t,H5SL_node_ptr_t,H5SL_LEVEL_MAX); static herr_t H5SL_init_interface(void) { - time_t curr_time; /* Current time, for seeding random number generator */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_init_interface) - /* Create randomized set of numbers */ - curr_time=HDtime(NULL); - HDsrand((unsigned)curr_time); + /* Allocate space for array of factories */ + H5SL_fac_g = (H5FL_fac_head_t **)H5MM_malloc(sizeof(H5FL_fac_head_t *)); + H5SL_fac_nalloc_g = 1; + + /* Initialize first factory */ + H5SL_fac_g[0] = H5FL_fac_init(sizeof(H5SL_node_t *)); + H5SL_fac_nused_g = 1; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SL_init_interface() */ @@ -255,87 +547,45 @@ H5SL_init_interface(void) /*-------------------------------------------------------------------------- NAME - H5SL_random_level - PURPOSE - Generate a random level - USAGE - size_t H5SL_random_level(p,max_level) - int p1; IN: probability distribution - size_t max_level; IN: Maximum level for node height - - RETURNS - Returns non-negative level value - DESCRIPTION - Count elements in a skip list. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Do we really need a 'random' value, or is a series of nodes with the - correct heights "good enough". We could track the state of the nodes - allocated for this list and issue node heights appropriately (i.e. 1,2, - 1,4,1,2,1,8,...) (or would that be 1,1,2,1,1,2,4,... ?) - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static size_t -H5SL_random_level(int p1, size_t max_level) -{ - size_t lvl; /* Level generated */ - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_random_level); - - /* Account for starting at zero offset */ - max_level--; - - lvl=0; - while(HDrand()key = key; ret_value->item = item; - ret_value->level = lvl; + ret_value->level = 0; ret_value->hashval = hashval; - ret_value->forward = (H5SL_node_t **)((unsigned char *)ret_value + sizeof(H5SL_node_t)); + if(NULL == (ret_value->forward = (H5SL_node_t **)H5FL_FAC_MALLOC(H5SL_fac_g[0]))) + HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, NULL, "memory allocation failed") + ret_value->log_nalloc = 0; done: FUNC_LEAVE_NOAPI(ret_value) @@ -366,18 +616,16 @@ done: static H5SL_node_t * H5SL_insert_common(H5SL_t *slist, void *item, const void *key) { - H5SL_node_t **update[H5SL_LEVEL_MAX]; /* 'update' vector */ H5SL_node_t *x; /* Current node to examine */ + H5SL_node_t *prev; /* Node before the new node */ uint32_t hashval = 0; /* Hash value for key */ - size_t lvl; /* Level of new node */ - int i; /* Local index value */ H5SL_node_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5SL_insert_common); /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -387,75 +635,60 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) /* Work through the forward pointers for a node, finding the node at each * level that is before the location to insert */ - x=slist->header; + prev=slist->header; switch(slist->type) { case H5SL_TYPE_INT: - H5SL_INSERT(SCALAR, slist, x, update, const int, key, -) + H5SL_INSERT(SCALAR, slist, prev, const int, key, -) break; case H5SL_TYPE_HADDR: - H5SL_INSERT(SCALAR, slist, x, update, const haddr_t, key, -) + H5SL_INSERT(SCALAR, slist, prev, const haddr_t, key, -) break; case H5SL_TYPE_STR: - H5SL_INSERT(STRING, slist, x, update, char *, key, hashval) + H5SL_INSERT(STRING, slist, prev, char *, key, hashval) break; case H5SL_TYPE_HSIZE: - H5SL_INSERT(SCALAR, slist, x, update, const hsize_t, key, -) + H5SL_INSERT(SCALAR, slist, prev, const hsize_t, key, -) break; case H5SL_TYPE_UNSIGNED: - H5SL_INSERT(SCALAR, slist, x, update, const unsigned, key, -) + H5SL_INSERT(SCALAR, slist, prev, const unsigned, key, -) break; case H5SL_TYPE_SIZE: - H5SL_INSERT(SCALAR, slist, x, update, const size_t, key, -) + H5SL_INSERT(SCALAR, slist, prev, const size_t, key, -) break; case H5SL_TYPE_OBJ: - H5SL_INSERT(OBJ, slist, x, update, const H5_obj_t, key, -) + H5SL_INSERT(OBJ, slist, prev, const H5_obj_t, key, -) break; default: HDassert(0 && "Unknown skiplist type!"); } /* end switch */ - /* 'key' must not have been found in existing list, if we get here */ - - /* Generate level for new node */ - lvl=H5SL_random_level(slist->p1,slist->max_level); - if((int)lvl>slist->curr_level) { - /* Cap the increase in the current level to just one greater */ - lvl=slist->curr_level+1; - /* Set the update pointer correctly */ - update[lvl]=&slist->header->forward[lvl]; + /* 'key' must not have been found in existing list, if we get here */ - /* Increase the maximum level of the list */ - slist->curr_level=(int)lvl; - } /* end if */ + if(slist->curr_level < 0) + slist->curr_level = 0; - /* Create new node of proper level */ - if(NULL == (x = H5SL_new_node(lvl, item, key, hashval))) + /* Create new node of level 0 */ + if(NULL == (x = H5SL_new_node(item, key, hashval))) HGOTO_ERROR(H5E_SLIST ,H5E_NOSPACE, NULL, "can't create new skip list node") - /* Update the backward links */ - if(*update[0]!=NULL) { - x->backward=(*update[0])->backward; - (*update[0])->backward=x; - } /* end if */ + /* Update the links */ + x->backward = prev; + x->forward[0] = prev->forward[0]; + prev->forward[0] = x; + if(x->forward[0]) + x->forward[0]->backward = x; else { HDassert(slist->last); - x->backward=slist->last; - slist->last=x; - } /* end else */ - - /* Link the new node into the existing forward pointers */ - for(i=0; i<=(int)lvl; i++) { - x->forward[i]=*update[i]; - *update[i]=x; - } /* end for */ + slist->last = x; + } /* Increment the number of nodes in the skip list */ slist->nobjs++; @@ -474,7 +707,7 @@ done: PURPOSE Release all nodes from a skip list, optionally calling a 'free' operator USAGE - herr_t H5SL_release_common(slist) + herr_t H5SL_release_common(slist,op,opdata) H5SL_t *slist; IN/OUT: Pointer to skip list to release nodes H5SL_operator_t op; IN: Callback function to free item & key void *op_data; IN/OUT: Pointer to application data for callback @@ -496,9 +729,9 @@ herr_t H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { H5SL_node_t *node, *next_node; /* Pointers to skip list nodes */ - size_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_release_common); + FUNC_ENTER_NOAPI_NOINIT(H5SL_release_common); /* Check args */ assert(slist); @@ -516,13 +749,18 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* Casting away const OK -QAK */ (void)(op)(node->item,(void *)node->key,op_data); - H5FL_ARR_FREE(H5SL_node_ptr_t,node); + (void)H5FL_FAC_FREE(H5SL_fac_g[node->log_nalloc], node->forward); + (void)H5FL_FREE(H5SL_node_t, node); node=next_node; } /* end while */ /* Reset the header pointers */ - for(u=0; umax_level; u++) - slist->header->forward[u]=NULL; + (void)H5FL_FAC_FREE(H5SL_fac_g[slist->header->log_nalloc], slist->header->forward); + if(NULL == (slist->header->forward = (H5SL_node_t **) H5FL_FAC_MALLOC(H5SL_fac_g[0]))) + HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, FAIL, "memory allocation failed") + slist->header->forward[0] = NULL; + slist->header->log_nalloc = 0; + slist->header->level = 0; /* Reset the last pointer */ slist->last=slist->header; @@ -531,7 +769,8 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) slist->curr_level=-1; slist->nobjs=0; - FUNC_LEAVE_NOAPI(SUCCEED); +done: + FUNC_LEAVE_NOAPI(ret_value); } /* end H5SL_release_common() */ @@ -561,7 +800,9 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_close_common) + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT(H5SL_close_common) /* Check args */ HDassert(slist); @@ -570,15 +811,18 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Free skip list nodes */ - (void)H5SL_release_common(slist, op, op_data); /* always succeeds */ + if(H5SL_release_common(slist, op, op_data) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") /* Release header node */ - H5FL_ARR_FREE(H5SL_node_ptr_t, slist->header); + (void)H5FL_FAC_FREE(H5SL_fac_g[slist->header->log_nalloc], slist->header->forward); + (void)H5FL_FREE(H5SL_node_t, slist->header); /* Free skip list object */ (void)H5FL_FREE(H5SL_t, slist); - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_close_common() */ @@ -588,7 +832,7 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) PURPOSE Create a skip list USAGE - H5SL_t *H5SL_create(void) + H5SL_t *H5SL_create(H5SL_type_t type) RETURNS Returns a pointer to a skip list on success, NULL on failure. @@ -600,18 +844,15 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) REVISION LOG --------------------------------------------------------------------------*/ H5SL_t * -H5SL_create(H5SL_type_t type, double p, size_t max_level) +H5SL_create(H5SL_type_t type) { H5SL_t *new_slist = NULL; /* Pointer to new skip list object created */ H5SL_node_t *header; /* Pointer to skip list header node */ - size_t u; /* Local index variable */ H5SL_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5SL_create,NULL); /* Check args */ - HDassert(p>0.0 && p<1.0); - HDassert(max_level>0 && max_level<=H5SL_LEVEL_MAX); HDassert(type>=H5SL_TYPE_INT && type<=H5SL_TYPE_OBJ); /* Allocate skip list structure */ @@ -620,21 +861,17 @@ H5SL_create(H5SL_type_t type, double p, size_t max_level) /* Set the static internal fields */ new_slist->type = type; - new_slist->p = p; - new_slist->p1 = (int)(p*RAND_MAX); - new_slist->max_level = max_level; /* Set the dynamic internal fields */ new_slist->curr_level = -1; new_slist->nobjs = 0; /* Allocate the header node */ - if(NULL == (header = H5SL_new_node((max_level - 1), NULL, NULL, ULONG_MAX))) + if(NULL == (header = H5SL_new_node(NULL, NULL, ULONG_MAX))) HGOTO_ERROR(H5E_SLIST ,H5E_NOSPACE, NULL, "can't create new skip list node") - /* Initialize header node's forward pointers */ - for(u = 0; u < max_level; u++) - header->forward[u] = NULL; + /* Initialize header node's forward pointer */ + header->forward[0] = NULL; /* Initialize header node's backward pointer */ header->backward = NULL; @@ -803,12 +1040,11 @@ done: void * H5SL_remove(H5SL_t *slist, const void *key) { - H5SL_node_t **update[H5SL_LEVEL_MAX]; /* 'update' vector */ H5SL_node_t *x; /* Current node to examine */ uint32_t hashval = 0; /* Hash value for key */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_remove) + FUNC_ENTER_NOAPI_NOINIT(H5SL_remove) /* Check args */ HDassert(slist); @@ -825,31 +1061,31 @@ H5SL_remove(H5SL_t *slist, const void *key) x = slist->header; switch(slist->type) { case H5SL_TYPE_INT: - H5SL_REMOVE(SCALAR, slist, x, update, const int, key, -) + H5SL_REMOVE(SCALAR, slist, x, const int, key, -) break; case H5SL_TYPE_HADDR: - H5SL_REMOVE(SCALAR, slist, x, update, const haddr_t, key, -) + H5SL_REMOVE(SCALAR, slist, x, const haddr_t, key, -) break; case H5SL_TYPE_STR: - H5SL_REMOVE(STRING, slist, x, update, char *, key, hashval) + H5SL_REMOVE(STRING, slist, x, char *, key, hashval) break; case H5SL_TYPE_HSIZE: - H5SL_REMOVE(SCALAR, slist, x, update, const hsize_t, key, -) + H5SL_REMOVE(SCALAR, slist, x, const hsize_t, key, -) break; case H5SL_TYPE_UNSIGNED: - H5SL_REMOVE(SCALAR, slist, x, update, const unsigned, key, -) + H5SL_REMOVE(SCALAR, slist, x, const unsigned, key, -) break; case H5SL_TYPE_SIZE: - H5SL_REMOVE(SCALAR, slist, x, update, const size_t, key, -) + H5SL_REMOVE(SCALAR, slist, x, const size_t, key, -) break; case H5SL_TYPE_OBJ: - H5SL_REMOVE(OBJ, slist, x, update, const H5_obj_t, key, -) + H5SL_REMOVE(OBJ, slist, x, const H5_obj_t, key, -) break; default: @@ -876,8 +1112,6 @@ done: Remove first element from a skip list. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS - This algorithm is basically the same as the one in the - H5SL_LOCATE_REMOVE_FOUND macro, fix bugs in both places EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ @@ -885,8 +1119,13 @@ void * H5SL_remove_first(H5SL_t *slist) { void *ret_value = NULL; /* Return value */ + H5SL_node_t *head = slist->header; /* Skip list header */ + H5SL_node_t *tmp = slist->header->forward[0]; /* Temporary node pointer */ + H5SL_node_t *next; /* Next node to search for */ + size_t level = slist->curr_level; /* Skip list level */ + size_t i; /* Index */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_remove_first) + FUNC_ENTER_NOAPI_NOINIT(H5SL_remove_first) /* Check args */ HDassert(slist); @@ -898,39 +1137,62 @@ H5SL_remove_first(H5SL_t *slist) /* Check for empty list */ if(slist->last != slist->header) { - H5SL_node_t *x; /* Current node to examine */ - int i; /* Local index value */ - /* Get pointer to first node on the list */ - x = slist->header->forward[0]; - - /* Patch forward pointers in list header around node to remove */ - for(i = 0; i <= (int)slist->curr_level; i++) { - if(slist->header->forward[i] != x) - break; - slist->header->forward[i] = x->forward[i]; - } /* end for */ + /* Assign return value */ + ret_value = tmp->item; + HDassert(level == head->level); + HDassert(0 == tmp->level); - /* Update tail/backward pointer */ - if(slist->last == x) - slist->last = x->backward; + /* Remove the first node */ + head->forward[0] = tmp->forward[0]; + if(slist->last == tmp) + slist->last = head; else - x->forward[0]->backward = x->backward; - - /* Get the item to return */ - ret_value = x->item; - - /* Free the skip list node */ - H5FL_ARR_FREE(H5SL_node_ptr_t, x); - - /* Lower the level of the list, if we removed the tallest node */ - while(slist->curr_level > 0 && slist->header->forward[slist->curr_level] == NULL) - slist->curr_level--; - - /* Decrement the # of objects in the list */ + tmp->forward[0]->backward = head; slist->nobjs--; + /* Free memory */ + (void)H5FL_FAC_FREE(H5SL_fac_g[0], tmp->forward); + (void)H5FL_FREE(H5SL_node_t, tmp); + + /* Reshape the skip list as necessary to maintain 1-2-3 condition */ + for(i=0; i < level; i++) { + next = head->forward[i+1]; + HDassert(next); + + /* Check if head->forward[i] == head->forward[i+1] (illegal) */ + if(head->forward[i] == next) { + tmp = next; + next = next->forward[i+1]; + + HDassert(tmp->level == i+1); + + /* Demote head->forward[i] */ + H5SL_DEMOTE(tmp, head) + + /* Check if we need to promote the following node to maintain + * 1-2-3 condition */ + if(tmp->forward[i]->forward[i] != next) { + HDassert(tmp->forward[i]->forward[i]->forward[i] == next || + tmp->forward[i]->forward[i]->forward[i]->forward[i] == next); + tmp = tmp->forward[i]; + H5SL_PROMOTE(slist, tmp, head); + /* In this case, since there is a node of height = i+1 here + * now (tmp), we know the skip list must be valid and can + * break */ + break; + } else if(!head->forward[i+1]) { + /* We just shrunk the largest node, shrink the header */ + HDassert(i == level - 1); + + H5SL_SHRINK(head, level) + slist->curr_level--; + } /* end else */ + } else + break; + } /* end for */ } /* end if */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_remove_first() */ @@ -978,31 +1240,31 @@ H5SL_search(H5SL_t *slist, const void *key) x=slist->header; switch(slist->type) { case H5SL_TYPE_INT: - H5SL_SEARCH(SCALAR, slist, x, -, const int, key, -) + H5SL_SEARCH(SCALAR, slist, x, const int, key, -) break; case H5SL_TYPE_HADDR: - H5SL_SEARCH(SCALAR, slist, x, -, const haddr_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const haddr_t, key, -) break; case H5SL_TYPE_STR: - H5SL_SEARCH(STRING, slist, x, -, char *, key, hashval) + H5SL_SEARCH(STRING, slist, x, char *, key, hashval) break; case H5SL_TYPE_HSIZE: - H5SL_SEARCH(SCALAR, slist, x, -, const hsize_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const hsize_t, key, -) break; case H5SL_TYPE_UNSIGNED: - H5SL_SEARCH(SCALAR, slist, x, -, const unsigned, key, -) + H5SL_SEARCH(SCALAR, slist, x, const unsigned, key, -) break; case H5SL_TYPE_SIZE: - H5SL_SEARCH(SCALAR, slist, x, -, const size_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const size_t, key, -) break; case H5SL_TYPE_OBJ: - H5SL_SEARCH(OBJ, slist, x, -, const H5_obj_t, key, -) + H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; default: @@ -1063,31 +1325,31 @@ H5SL_less(H5SL_t *slist, const void *key) x=slist->header; switch(slist->type) { case H5SL_TYPE_INT: - H5SL_SEARCH(SCALAR, slist, x, -, const int, key, -) + H5SL_SEARCH(SCALAR, slist, x, const int, key, -) break; case H5SL_TYPE_HADDR: - H5SL_SEARCH(SCALAR, slist, x, -, const haddr_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const haddr_t, key, -) break; case H5SL_TYPE_STR: - H5SL_SEARCH(STRING, slist, x, -, char *, key, hashval) + H5SL_SEARCH(STRING, slist, x, char *, key, hashval) break; case H5SL_TYPE_HSIZE: - H5SL_SEARCH(SCALAR, slist, x, -, const hsize_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const hsize_t, key, -) break; case H5SL_TYPE_UNSIGNED: - H5SL_SEARCH(SCALAR, slist, x, -, const unsigned, key, -) + H5SL_SEARCH(SCALAR, slist, x, const unsigned, key, -) break; case H5SL_TYPE_SIZE: - H5SL_SEARCH(SCALAR, slist, x, -, const size_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const size_t, key, -) break; case H5SL_TYPE_OBJ: - H5SL_SEARCH(OBJ, slist, x, -, const H5_obj_t, key, -) + H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; default: @@ -1161,31 +1423,31 @@ H5SL_greater(H5SL_t *slist, const void *key) x = slist->header; switch(slist->type) { case H5SL_TYPE_INT: - H5SL_SEARCH(SCALAR, slist, x, -, const int, key, -) + H5SL_SEARCH(SCALAR, slist, x, const int, key, -) break; case H5SL_TYPE_HADDR: - H5SL_SEARCH(SCALAR, slist, x, -, const haddr_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const haddr_t, key, -) break; case H5SL_TYPE_STR: - H5SL_SEARCH(STRING, slist, x, -, char *, key, hashval) + H5SL_SEARCH(STRING, slist, x, char *, key, hashval) break; case H5SL_TYPE_HSIZE: - H5SL_SEARCH(SCALAR, slist, x, -, const hsize_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const hsize_t, key, -) break; case H5SL_TYPE_UNSIGNED: - H5SL_SEARCH(SCALAR, slist, x, -, const unsigned, key, -) + H5SL_SEARCH(SCALAR, slist, x, const unsigned, key, -) break; case H5SL_TYPE_SIZE: - H5SL_SEARCH(SCALAR, slist, x, -, const size_t, key, -) + H5SL_SEARCH(SCALAR, slist, x, const size_t, key, -) break; case H5SL_TYPE_OBJ: - H5SL_SEARCH(OBJ, slist, x, -, const H5_obj_t, key, -) + H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; default: @@ -1249,31 +1511,31 @@ H5SL_find(H5SL_t *slist, const void *key) x=slist->header; switch(slist->type) { case H5SL_TYPE_INT: - H5SL_FIND(SCALAR, slist, x, -, const int, key, -) + H5SL_FIND(SCALAR, slist, x, const int, key, -) break; case H5SL_TYPE_HADDR: - H5SL_FIND(SCALAR, slist, x, -, const haddr_t, key, -) + H5SL_FIND(SCALAR, slist, x, const haddr_t, key, -) break; case H5SL_TYPE_STR: - H5SL_FIND(STRING, slist, x, -, char *, key, hashval) + H5SL_FIND(STRING, slist, x, char *, key, hashval) break; case H5SL_TYPE_HSIZE: - H5SL_FIND(SCALAR, slist, x, -, const hsize_t, key, -) + H5SL_FIND(SCALAR, slist, x, const hsize_t, key, -) break; case H5SL_TYPE_UNSIGNED: - H5SL_FIND(SCALAR, slist, x, -, const unsigned, key, -) + H5SL_FIND(SCALAR, slist, x, const unsigned, key, -) break; case H5SL_TYPE_SIZE: - H5SL_FIND(SCALAR, slist, x, -, const size_t, key, -) + H5SL_FIND(SCALAR, slist, x, const size_t, key, -) break; case H5SL_TYPE_OBJ: - H5SL_FIND(OBJ, slist, x, -, const H5_obj_t, key, -) + H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; default: @@ -1334,31 +1596,31 @@ H5SL_below(H5SL_t *slist, const void *key) x = slist->header; switch(slist->type) { case H5SL_TYPE_INT: - H5SL_FIND(SCALAR, slist, x, -, const int, key, -) + H5SL_FIND(SCALAR, slist, x, const int, key, -) break; case H5SL_TYPE_HADDR: - H5SL_FIND(SCALAR, slist, x, -, const haddr_t, key, -) + H5SL_FIND(SCALAR, slist, x, const haddr_t, key, -) break; case H5SL_TYPE_STR: - H5SL_FIND(STRING, slist, x, -, char *, key, hashval) + H5SL_FIND(STRING, slist, x, char *, key, hashval) break; case H5SL_TYPE_HSIZE: - H5SL_FIND(SCALAR, slist, x, -, const hsize_t, key, -) + H5SL_FIND(SCALAR, slist, x, const hsize_t, key, -) break; case H5SL_TYPE_UNSIGNED: - H5SL_FIND(SCALAR, slist, x, -, const unsigned, key, -) + H5SL_FIND(SCALAR, slist, x, const unsigned, key, -) break; case H5SL_TYPE_SIZE: - H5SL_FIND(SCALAR, slist, x, -, const size_t, key, -) + H5SL_FIND(SCALAR, slist, x, const size_t, key, -) break; case H5SL_TYPE_OBJ: - H5SL_FIND(OBJ, slist, x, -, const H5_obj_t, key, -) + H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; } /* end switch */ @@ -1429,31 +1691,31 @@ H5SL_above(H5SL_t *slist, const void *key) x = slist->header; switch(slist->type) { case H5SL_TYPE_INT: - H5SL_FIND(SCALAR, slist, x, -, const int, key, -) + H5SL_FIND(SCALAR, slist, x, const int, key, -) break; case H5SL_TYPE_HADDR: - H5SL_FIND(SCALAR, slist, x, -, const haddr_t, key, -) + H5SL_FIND(SCALAR, slist, x, const haddr_t, key, -) break; case H5SL_TYPE_STR: - H5SL_FIND(STRING, slist, x, -, char *, key, hashval) + H5SL_FIND(STRING, slist, x, char *, key, hashval) break; case H5SL_TYPE_HSIZE: - H5SL_FIND(SCALAR, slist, x, -, const hsize_t, key, -) + H5SL_FIND(SCALAR, slist, x, const hsize_t, key, -) break; case H5SL_TYPE_UNSIGNED: - H5SL_FIND(SCALAR, slist, x, -, const unsigned, key, -) + H5SL_FIND(SCALAR, slist, x, const unsigned, key, -) break; case H5SL_TYPE_SIZE: - H5SL_FIND(SCALAR, slist, x, -, const size_t, key, -) + H5SL_FIND(SCALAR, slist, x, const size_t, key, -) break; case H5SL_TYPE_OBJ: - H5SL_FIND(OBJ, slist, x, -, const H5_obj_t, key, -) + H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; } /* end switch */ @@ -1868,3 +2130,50 @@ H5SL_close(H5SL_t *slist) FUNC_LEAVE_NOAPI(SUCCEED); } /* end H5SL_close() */ + +/*-------------------------------------------------------------------------- + NAME + H5SL_term_interface + PURPOSE + Terminate all the H5FL factories used in this package, and clear memory + USAGE + int H5SL_term_interface() + RETURNS + Success: Positive if any action might have caused a change in some + other interface; zero otherwise. + Failure: Negative + DESCRIPTION + Release any resources allocated. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int H5SL_term_interface(void) +{ + size_t i; + herr_t ret; + int n = H5_interface_initialize_g ? 1 : 0; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_term_interface) + + if(n) { + /* Terminate all the factories */ + for(i=0; i= 0); + } + H5SL_fac_nused_g = 0; + + /* Free the list of factories */ + H5SL_fac_g = (H5FL_reg_head_t **)H5MM_xfree((void *)H5SL_fac_g); + H5SL_fac_nalloc_g = 0; + + /* Mark the interface as uninitialized */ + H5_interface_initialize_g = 0; + } /* end if */ + + FUNC_LEAVE_NOAPI(n); +} /* H5SL_term_interface() */ + diff --git a/src/H5SLprivate.h b/src/H5SLprivate.h index 27bb4d1..40fbfa9 100644 --- a/src/H5SLprivate.h +++ b/src/H5SLprivate.h @@ -53,7 +53,6 @@ typedef enum { /**********/ /* Macros */ /**********/ -#define H5SL_LEVEL_MAX 32 /* (for now) */ /* Typedef for iteration operations */ typedef herr_t (*H5SL_operator_t)(void *item, void *key, @@ -62,7 +61,7 @@ typedef herr_t (*H5SL_operator_t)(void *item, void *key, /********************/ /* Private routines */ /********************/ -H5_DLL H5SL_t *H5SL_create(H5SL_type_t type, double p, size_t max_level); +H5_DLL H5SL_t *H5SL_create(H5SL_type_t type); H5_DLL size_t H5SL_count(H5SL_t *slist); H5_DLL herr_t H5SL_insert(H5SL_t *slist, void *item, const void *key); H5_DLL H5SL_node_t *H5SL_add(H5SL_t *slist, void *item, const void *key); @@ -84,6 +83,7 @@ H5_DLL herr_t H5SL_release(H5SL_t *slist); H5_DLL herr_t H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data); H5_DLL herr_t H5SL_close(H5SL_t *slist); H5_DLL herr_t H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data); +H5_DLL int H5SL_term_interface(void); #endif /* _H5SLprivate_H */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 90b7a21..c621bf4 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -194,7 +194,7 @@ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ @@ -203,7 +203,7 @@ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ - *((DT*)D) = (D_MIN); \ + *((DT*)D) = (DT)(D_MIN); \ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ @@ -212,9 +212,9 @@ } #define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ if (*((ST*)S) > (DT)(D_MAX)) { \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ } else if (*((ST*)S) < (DT)(D_MIN)) { \ - *((DT*)D) = (D_MIN); \ + *((DT*)D) = (DT)(D_MIN); \ } else \ *((DT*)D) = (DT)(*((ST*)S)); \ } @@ -225,7 +225,7 @@ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ @@ -234,7 +234,7 @@ } #define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ if (*((ST*)S) > (DT)(D_MAX)) { \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ } else \ *((DT*)D) = (DT)(*((ST*)S)); \ } @@ -270,12 +270,12 @@ } #define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (sizeof(ST)==sizeof(DT) && *((ST*)S) > (D_MAX)) { \ + if (sizeof(ST)==sizeof(DT) && *((ST*)S) > (DT)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ @@ -319,7 +319,7 @@ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ @@ -330,7 +330,7 @@ if (*((ST*)S) < 0) { \ *((DT*)D) = 0; \ } else if (sizeof(ST)>sizeof(DT) && *((ST*)S) > (DT)(D_MAX)) { \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ } else \ *((DT*)D) = (DT)(*((ST*)S)); \ } @@ -384,7 +384,7 @@ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ @@ -394,7 +394,7 @@ #define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ if (*((ST*)S) > (DT)(D_MAX)) { \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ } else \ *((DT*)D) = (DT)(*((ST*)S)); \ } @@ -553,7 +553,7 @@ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ @@ -562,7 +562,7 @@ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ - *((DT*)D) = (D_MIN); \ + *((DT*)D) = (DT)(D_MIN); \ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ @@ -581,9 +581,9 @@ } #define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ if (*((ST*)S) > (DT)(D_MAX)) { \ - *((DT*)D) = (D_MAX); \ + *((DT*)D) = (DT)(D_MAX); \ } else if (*((ST*)S) < (DT)(D_MIN)) { \ - *((DT*)D) = (D_MIN); \ + *((DT*)D) = (DT)(D_MIN); \ } \ else \ *((DT*)D) = (DT)(*((ST*)S)); \ @@ -621,7 +621,7 @@ case H5T_CONV_INIT: \ /* Sanity check and initialize statistics */ \ cdata->need_bkg = H5T_BKG_NO; \ - if (NULL==(st=H5I_object(src_id)) || NULL==(dt=H5I_object(dst_id))) \ + if (NULL==(st=(H5T_t*)H5I_object(src_id)) || NULL==(dt=(H5T_t*)H5I_object(dst_id))) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \ "unable to dereference datatype object ID") \ if (st->shared->size!=sizeof(ST) || dt->shared->size!=sizeof(DT)) \ @@ -669,7 +669,7 @@ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); \ \ /* Get source and destination datatypes */ \ - if (NULL==(st=H5I_object(src_id)) || NULL==(dt=H5I_object(dst_id))) \ + if (NULL==(st=(H5T_t*)H5I_object(src_id)) || NULL==(dt=(H5T_t*)H5I_object(dst_id))) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \ "unable to dereference datatype object ID") \ \ @@ -714,7 +714,7 @@ } /* end if */ \ else { \ /* Single forward pass over all data */ \ - src = dst = buf; \ + src = dst = (uint8_t*)buf; \ safe=nelmts; \ } /* end else */ \ \ @@ -9755,8 +9755,8 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, switch (cdata->command) { case H5T_CONV_INIT: - if (NULL==(src_p=H5I_object(src_id)) || - NULL==(dst_p=H5I_object(dst_id))) + if (NULL==(src_p=(H5T_t*)H5I_object(src_id)) || + NULL==(dst_p=(H5T_t*)H5I_object(dst_id))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; @@ -9774,8 +9774,8 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_CONV_CONV: /* Get the datatypes */ - if (NULL==(src_p=H5I_object(src_id)) || - NULL==(dst_p=H5I_object(dst_id))) + if (NULL==(src_p=(H5T_t*)H5I_object(src_id)) || + NULL==(dst_p=(H5T_t*)H5I_object(dst_id))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; @@ -10345,8 +10345,8 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, switch (cdata->command) { case H5T_CONV_INIT: - if (NULL==(src_p=H5I_object(src_id)) || - NULL==(dst_p=H5I_object(dst_id))) + if (NULL==(src_p=(H5T_t*)H5I_object(src_id)) || + NULL==(dst_p=(H5T_t*)H5I_object(dst_id))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; @@ -10364,8 +10364,8 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_CONV_CONV: /* Get the datatypes */ - if (NULL==(src_p=H5I_object(src_id)) || - NULL==(dst_p=H5I_object(dst_id))) + if (NULL==(src_p=(H5T_t*)H5I_object(src_id)) || + NULL==(dst_p=(H5T_t*)H5I_object(dst_id))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; diff --git a/src/H5Z.c b/src/H5Z.c index 4df6abd..417ae77 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -53,7 +53,7 @@ typedef enum { /* Local variables */ static size_t H5Z_table_alloc_g = 0; static size_t H5Z_table_used_g = 0; -static H5Z_class_t *H5Z_table_g = NULL; +static H5Z_class2_t *H5Z_table_g = NULL; #ifdef H5Z_DEBUG static H5Z_stats_t *H5Z_stat_table_g = NULL; #endif /* H5Z_DEBUG */ @@ -191,7 +191,7 @@ H5Z_term_interface(void) } #endif /* H5Z_DEBUG */ /* Free the table of filters */ - H5Z_table_g = (H5Z_class_t *)H5MM_xfree(H5Z_table_g); + H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); #ifdef H5Z_DEBUG H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g); #endif /* H5Z_DEBUG */ @@ -220,32 +220,62 @@ H5Z_term_interface(void) *------------------------------------------------------------------------- */ herr_t -H5Zregister(const H5Z_class_t *cls) +H5Zregister(const void *cls) { - herr_t ret_value=SUCCEED; /* Return value */ + const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */ + H5Z_class2_t cls_new; /* Translated class struct */ + herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_API(H5Zregister, FAIL) - H5TRACE1("e", "*Zc", cls); + H5TRACE1("e", "*x", cls); /* Check args */ - if (cls==NULL) + if (cls_real==NULL) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class") /* Check H5Z_class_t version number; this is where a function to convert * from an outdated version should be called. + * + * If the version number is invalid, we assume that the target of cls is the + * old style "H5Z_class1_t" structure, which did not contain a version + * field. In this structure, the first field is the id. Since both version + * and id are integers they will have the same value, and since id must be + * at least 256, there should be no overlap and the version of the struct + * can be determined by the value of the first field. */ - if(cls->version != H5Z_CLASS_T_VERS) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + if(cls_real->version != H5Z_CLASS_T_VERS) { +#ifndef H5_NO_DEPRECATED_SYMBOLS + /* Assume it is an old "H5Z_class1_t" instead */ + const H5Z_class1_t *cls_old = (const H5Z_class1_t *) cls; + + /* Translate to new H5Z_class2_t */ + cls_new.version = H5Z_CLASS_T_VERS; + cls_new.id = cls_old->id; + cls_new.encoder_present = 1; + cls_new.decoder_present = 1; + cls_new.name = cls_old->name; + cls_new.can_apply = cls_old->can_apply; + cls_new.set_local = cls_old->set_local; + cls_new.filter = cls_old->filter; + + /* Set cls_real to point to the translated structure */ + cls_real = &cls_new; + +#else /* H5_NO_DEPRECATED_SYMBOLS */ + /* Deprecated symbols not allowed, throw an error */ + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + } /* end if */ - if (cls->id<0 || cls->id>H5Z_FILTER_MAX) + if (cls_real->id<0 || cls_real->id>H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if (cls->ididfilter==NULL) + if (cls_real->filter==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") /* Do it */ - if (H5Z_register (cls)<0) + if (H5Z_register (cls_real)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: @@ -269,7 +299,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Z_register (const H5Z_class_t *cls) +H5Z_register (const H5Z_class2_t *cls) { size_t i; herr_t ret_value = SUCCEED; /* Return value */ @@ -288,7 +318,7 @@ H5Z_register (const H5Z_class_t *cls) if(i >= H5Z_table_used_g) { if(H5Z_table_used_g >= H5Z_table_alloc_g) { size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5Z_table_alloc_g); - H5Z_class_t *table = (H5Z_class_t *)H5MM_realloc(H5Z_table_g, n * sizeof(H5Z_class_t)); + H5Z_class2_t *table = (H5Z_class2_t *)H5MM_realloc(H5Z_table_g, n * sizeof(H5Z_class2_t)); #ifdef H5Z_DEBUG H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ @@ -305,7 +335,7 @@ H5Z_register (const H5Z_class_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class_t)); + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); #ifdef H5Z_DEBUG HDmemset(H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ @@ -313,7 +343,7 @@ H5Z_register (const H5Z_class_t *cls) /* Filter already registered */ else { /* Replace old contents */ - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class_t)); + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -394,7 +424,7 @@ H5Z_unregister (H5Z_filter_t id) /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove(&H5Z_table_g[i],&H5Z_table_g[i+1],sizeof(H5Z_class_t)*((H5Z_table_used_g-1)-i)); + HDmemmove(&H5Z_table_g[i],&H5Z_table_g[i+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-i)); #ifdef H5Z_DEBUG HDmemmove(&H5Z_stat_table_g[i],&H5Z_stat_table_g[i+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-i)); #endif /* H5Z_DEBUG */ @@ -516,7 +546,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty /* Iterate over filters */ for(u = 0; u < dcpl_pline.nused; u++) { - H5Z_class_t *fclass; /* Individual filter information */ + H5Z_class2_t *fclass; /* Individual filter information */ /* Get filter information */ if(NULL == (fclass = H5Z_find(dcpl_pline.filter[u].id))) { @@ -890,11 +920,11 @@ done: * *------------------------------------------------------------------------- */ -H5Z_class_t * +H5Z_class2_t * H5Z_find(H5Z_filter_t id) { int idx; /* Filter index in global table */ - H5Z_class_t *ret_value=NULL; /* Return value */ + H5Z_class2_t *ret_value=NULL; /* Return value */ FUNC_ENTER_NOAPI(H5Z_find, NULL) @@ -946,7 +976,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, { size_t i, idx, new_nbytes; int fclass_idx; /* Index of filter class in global table */ - H5Z_class_t *fclass=NULL; /* Filter class pointer */ + H5Z_class2_t *fclass=NULL; /* Filter class pointer */ #ifdef H5Z_DEBUG H5Z_stats_t *fstats=NULL; /* Filter stats pointer */ H5_timer_t timer; @@ -1242,7 +1272,7 @@ done: herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) { - H5Z_class_t *fclass; + H5Z_class2_t *fclass; herr_t ret_value = SUCCEED; FUNC_ENTER_API(H5Zget_filter_info, FAIL) diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 56b910b..7cda2c8 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -37,7 +37,7 @@ static size_t H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class_t H5Z_DEFLATE[1] = {{ +const H5Z_class2_t H5Z_DEFLATE[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_DEFLATE, /* Filter id number */ 1, /* encoder_present flag (set to true) */ diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index aa3a173..e3a77bd 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -34,7 +34,7 @@ static size_t H5Z_filter_fletcher32 (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class_t H5Z_FLETCHER32[1] = {{ +const H5Z_class2_t H5Z_FLETCHER32[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_FLETCHER32, /* Filter id number */ 1, /* encoder_present flag (set to true) */ diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 97a00f0..6f090c3 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -80,7 +80,7 @@ static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned c size_t *buffer_size, const unsigned parms[]); /* This message derives from H5Z */ -H5Z_class_t H5Z_NBIT[1] = {{ +H5Z_class2_t H5Z_NBIT[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_NBIT, /* Filter id number */ 1, /* Assume encoder present: check before registering */ diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index 9cd126e..ae33def 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -42,46 +42,46 @@ /* * Deflate filter */ -H5_DLLVAR const H5Z_class_t H5Z_DEFLATE[1]; +H5_DLLVAR const H5Z_class2_t H5Z_DEFLATE[1]; #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SHUFFLE /* * Shuffle filter */ -H5_DLLVAR const H5Z_class_t H5Z_SHUFFLE[1]; +H5_DLLVAR const H5Z_class2_t H5Z_SHUFFLE[1]; #endif /* H5_HAVE_FILTER_SHUFFLE */ #ifdef H5_HAVE_FILTER_FLETCHER32 /* * Fletcher32 filter */ -H5_DLLVAR const H5Z_class_t H5Z_FLETCHER32[1]; +H5_DLLVAR const H5Z_class2_t H5Z_FLETCHER32[1]; #endif /* H5_HAVE_FILTER_FLETCHER32 */ #ifdef H5_HAVE_FILTER_SZIP /* * szip filter */ -H5_DLLVAR H5Z_class_t H5Z_SZIP[1]; +H5_DLLVAR H5Z_class2_t H5Z_SZIP[1]; #endif /* H5_HAVE_FILTER_SZIP */ #ifdef H5_HAVE_FILTER_NBIT /* * nbit filter */ -H5_DLLVAR H5Z_class_t H5Z_NBIT[1]; +H5_DLLVAR H5Z_class2_t H5Z_NBIT[1]; #endif /* H5_HAVE_FILTER_NBIT */ #ifdef H5_HAVE_FILTER_SCALEOFFSET /* * scaleoffset filter */ -H5_DLLVAR H5Z_class_t H5Z_SCALEOFFSET[1]; +H5_DLLVAR H5Z_class2_t H5Z_SCALEOFFSET[1]; #endif /* H5_HAVE_FILTER_SCALEOFFSET */ /* Package-local function prototypes */ -H5_DLL void H5Z_update_class_vers(H5Z_class_t * old_vers, H5Z_class_t * curr_vers); +H5_DLL void H5Z_update_class_vers(H5Z_class2_t * old_vers, H5Z_class2_t * curr_vers); #endif /* _H5Zpkg_H */ diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 15b7289..3ce0a0c 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -72,7 +72,8 @@ typedef struct { struct H5O_pline_t; /*forward decl*/ /* Internal API routines */ -H5_DLL herr_t H5Z_register(const H5Z_class_t *cls); +H5_DLL herr_t H5Z_init(void); +H5_DLL herr_t H5Z_register(const H5Z_class2_t *cls); H5_DLL herr_t H5Z_unregister(H5Z_filter_t id); H5_DLL herr_t H5Z_append(struct H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t cd_nelmts, const unsigned int cd_values[]); @@ -83,7 +84,7 @@ H5_DLL herr_t H5Z_pipeline(const struct H5O_pline_t *pline, H5Z_EDC_t edc_read, H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/); -H5_DLL H5Z_class_t *H5Z_find(H5Z_filter_t id); +H5_DLL H5Z_class2_t *H5Z_find(H5Z_filter_t id); H5_DLL herr_t H5Z_can_apply(hid_t dcpl_id, hid_t type_id); H5_DLL herr_t H5Z_set_local(hid_t dcpl_id, hid_t type_id); H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index ce60650..44d2bbb 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -206,7 +206,7 @@ typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, * The filter table maps filter identification numbers to structs that * contain a pointers to the filter function and timing statistics. */ -typedef struct H5Z_class_t { +typedef struct H5Z_class2_t { int version; /* Version number of the H5Z_class_t struct */ H5Z_filter_t id; /* Filter ID number */ unsigned encoder_present; /* Does this filter have an encoder? */ @@ -215,13 +215,33 @@ typedef struct H5Z_class_t { H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ H5Z_func_t filter; /* The actual filter function */ -} H5Z_class_t; +} H5Z_class2_t; -H5_DLL herr_t H5Zregister(const H5Z_class_t *cls); +H5_DLL herr_t H5Zregister(const void *cls); H5_DLL herr_t H5Zunregister(H5Z_filter_t id); H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id); H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags); +/* Symbols defined for compatibility with previous versions of the HDF5 API. + * + * Use of these symbols is deprecated. + */ +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/* + * The filter table maps filter identification numbers to structs that + * contain a pointers to the filter function and timing statistics. + */ +typedef struct H5Z_class1_t { + H5Z_filter_t id; /* Filter ID number */ + const char *name; /* Comment for debugging */ + H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ + H5Z_func_t filter; /* The actual filter function */ +} H5Z_class1_t; + +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + #ifdef __cplusplus } #endif diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 10618c3..d59499c 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -80,7 +80,7 @@ static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, uns size_t buffer_size, parms_atomic p); /* This message derives from H5Z */ -H5Z_class_t H5Z_SCALEOFFSET[1] = {{ +H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_SCALEOFFSET, /* Filter id number */ 1, /* Assume encoder present: check before registering */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 3f40707..2e4f1fa 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -32,7 +32,7 @@ static size_t H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class_t H5Z_SHUFFLE[1] = {{ +const H5Z_class2_t H5Z_SHUFFLE[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_SHUFFLE, /* Filter id number */ 1, /* encoder_present flag (set to true) */ diff --git a/src/H5Zszip.c b/src/H5Zszip.c index b40c028..5da92ac 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -40,7 +40,7 @@ static size_t H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -H5Z_class_t H5Z_SZIP[1] = {{ +H5Z_class2_t H5Z_SZIP[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_SZIP, /* Filter id number */ 1, /* Assume encoder present: check before registering */ diff --git a/src/H5config.h.in b/src/H5config.h.in index 1c70790..a3e879b 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -84,6 +84,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DMALLOC_H +/* Define if library information should be embedded in the executables */ +#undef HAVE_EMBEDDED_LIBINFO + /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H diff --git a/src/H5detect.c b/src/H5detect.c index b67c2b0..146750c 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -108,6 +108,7 @@ static void detect_C99_integers16(void); static void detect_C99_integers32(void); static void detect_C99_integers64(void); static void detect_alignments(void); +static void insert_libhdf5_settings(void); static size_t align_g[] = {1, 2, 4, 8, 16}; static jmp_buf jbuf_g; @@ -502,6 +503,64 @@ sigbus_handler(int UNUSED signo) /*------------------------------------------------------------------------- + * Function: insert_libhdf5_settings + * + * Purpose: Insert contents of libhdf5.settings so that it is included + * in all hdf5 executables. + * + * Return: void + * + * Programmer: Albert Cheng + * Apr 20, 2009 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +#define LIBSETTINGSFNAME "libhdf5.settings" +static void +insert_libhdf5_settings(void) +{ + FILE *fsettings; + char inchar; + int bol=0; /* indicates the beginning of a new line */ + + if (NULL==(fsettings=HDfopen(LIBSETTINGSFNAME, "r"))){ + perror(LIBSETTINGSFNAME); + exit(1); + } + /* print variable definition */ + printf("extern char H5libhdf5_settings[]=\n"); + bol++; + while (EOF != (inchar = getc(fsettings))){ + if (bol){ + /* Start a new line */ + printf("\t\""); + bol = 0; + } + if (inchar == '\n'){ + /* end of a line */ + printf("\\n\"\n"); + bol++; + }else{ + putchar(inchar); + } + } + if (feof(fsettings)){ + /* wrap up */ + if (!bol){ + /* EOF found without a new line */ + printf("\\n\"\n"); + }; + printf(";\n\n"); + }else{ + fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME); + exit(1); + } +} + + +/*------------------------------------------------------------------------- * Function: print_results * * Purpose: Prints information about the detected data types. @@ -580,6 +639,11 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) /*******************/\n\ \n"); +#ifdef H5_HAVE_EMBEDDED_LIBINFO + /* Insert content of libhdf5.settings */ + insert_libhdf5_settings(); +#endif + /* The interface initialization function */ printf("\n\ \n\ diff --git a/src/H5private.h b/src/H5private.h index 695b015..d392548 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -144,6 +144,7 @@ #define VC_EXTRALEAN /*Exclude rarely-used stuff from Windows headers */ #include +#include /* For _getcwd() */ #endif /*_WIN32*/ diff --git a/src/H5public.h b/src/H5public.h index 367e601..371847d 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -71,10 +71,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 36 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 39 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "FA_a1" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.36-FA_a1" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.39-FA_a1" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/H5trace.c b/src/H5trace.c index 4a42f0b..6e2578b 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1978,7 +1978,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } } else { - H5Z_class_t *filter = va_arg (ap, H5Z_class_t*); /*lint !e64 Type mismatch not really occuring */ + H5Z_class2_t *filter = va_arg (ap, H5Z_class2_t*); /*lint !e64 Type mismatch not really occuring */ fprintf (out, "0x%lx", (unsigned long)filter); } break; diff --git a/src/H5vers.txt b/src/H5vers.txt index 00ab84b..18a88d9 100644 --- a/src/H5vers.txt +++ b/src/H5vers.txt @@ -71,4 +71,5 @@ FUNCTION: H5Topen; ; v10, v18 # (although not required, it's easier to compare this file with the headers # generated if the list below is in alphanumeric sort order - QAK) TYPEDEF: H5E_auto; v10, v18 +TYPEDEF: H5Z_class; v16, v18 diff --git a/src/H5version.h b/src/H5version.h index fd9e780..58de2ab 100644 --- a/src/H5version.h +++ b/src/H5version.h @@ -134,6 +134,10 @@ #define H5E_auto_t_vers 1 #endif /* !defined(H5E_auto_t_vers) */ +#if !defined(H5Z_class_t_vers) +#define H5Z_class_t_vers 1 +#endif /* !defined(H5Z_class_t_vers) */ + #endif /* H5_USE_16_API */ @@ -399,5 +403,17 @@ #error "H5E_auto_t_vers set to invalid value" #endif /* H5E_auto_t_vers */ + +#if !defined(H5Z_class_t_vers) || H5Z_class_t_vers == 2 +#ifndef H5Z_class_t_vers +#define H5Z_class_t_vers 2 +#endif /* H5Z_class_t_vers */ +#define H5Z_class_t H5Z_class2_t +#elif H5Z_class_t_vers == 1 +#define H5Z_class_t H5Z_class1_t +#else /* H5Z_class_t_vers */ +#error "H5Z_class_t_vers set to invalid value" +#endif /* H5Z_class_t_vers */ + #endif /* H5version_H */ diff --git a/src/Makefile.am b/src/Makefile.am index b2b0a98..f6d92dd 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -61,7 +61,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5G.c H5Gbtree2.c H5Gcache.c \ H5Gcompact.c H5Gdense.c H5Gdeprec.c H5Gent.c \ H5Gint.c H5Glink.c \ - H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c H5Goh.c H5Gstab.c H5Gtest.c \ + H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c H5Goh.c H5Groot.c H5Gstab.c H5Gtest.c \ H5Gtraverse.c \ H5HF.c H5HFbtree2.c H5HFcache.c H5HFdbg.c H5HFdblock.c H5HFdtable.c \ H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFiter.c H5HFman.c H5HFsection.c \ diff --git a/src/Makefile.in b/src/Makefile.in index a437a3e..57a4cc8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -97,9 +97,9 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5FScache.lo H5FSdbg.lo H5FSsection.lo H5FSstat.lo H5FStest.lo \ H5G.lo H5Gbtree2.lo H5Gcache.lo H5Gcompact.lo H5Gdense.lo \ H5Gdeprec.lo H5Gent.lo H5Gint.lo H5Glink.lo H5Gloc.lo \ - H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo H5Gstab.lo H5Gtest.lo \ - H5Gtraverse.lo H5HF.lo H5HFbtree2.lo H5HFcache.lo H5HFdbg.lo \ - H5HFdblock.lo H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo \ + H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo H5Groot.lo H5Gstab.lo \ + H5Gtest.lo H5Gtraverse.lo H5HF.lo H5HFbtree2.lo H5HFcache.lo \ + H5HFdbg.lo H5HFdblock.lo H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo \ H5HFiblock.lo H5HFiter.lo H5HFman.lo H5HFsection.lo \ H5HFspace.lo H5HFstat.lo H5HFtest.lo H5HFtiny.lo H5HG.lo \ H5HGcache.lo H5HGdbg.lo H5HL.lo H5HLcache.lo H5HLdbg.lo \ @@ -409,7 +409,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 26 +LT_VERS_REVISION = 29 LT_VERS_AGE = 0 H5detect_CFLAGS = -g @@ -445,7 +445,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5G.c H5Gbtree2.c H5Gcache.c \ H5Gcompact.c H5Gdense.c H5Gdeprec.c H5Gent.c \ H5Gint.c H5Glink.c \ - H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c H5Goh.c H5Gstab.c H5Gtest.c \ + H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c H5Goh.c H5Groot.c H5Gstab.c H5Gtest.c \ H5Gtraverse.c \ H5HF.c H5HFbtree2.c H5HFcache.c H5HFdbg.c H5HFdblock.c H5HFdtable.c \ H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFiter.c H5HFman.c H5HFsection.c \ @@ -525,8 +525,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -711,6 +711,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gnode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gobj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Goh.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Groot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gstab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gtest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gtraverse.Plo@am__quote@ @@ -936,7 +937,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/test/Makefile.am b/test/Makefile.am index ae54149..1acf00f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -117,7 +117,8 @@ CHECK_CLEANFILES+=cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offset.h5 \ enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 \ tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin \ getname.h5 getname[1-3].h5 sec2_file.h5 direct_file.h5 \ - family_file000[0-3][0-9].h5 multi_file-[rs].h5 core_file \ + family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \ + multi_file-[rs].h5 core_file \ new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 \ dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ diff --git a/test/Makefile.in b/test/Makefile.in index 8c44d5a..50a17b1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -643,8 +643,9 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog cmpd_dset.h5 \ tvlstr.h5 tvlstr2.h5 flush.h5 enum1.h5 titerate.h5 ttsafe.h5 \ tarray1.h5 tgenprop.h5 tmisc[0-9]*.h5 set_extent[1-5].h5 \ ext[12].bin getname.h5 getname[1-3].h5 sec2_file.h5 \ - direct_file.h5 family_file000[0-3][0-9].h5 multi_file-[rs].h5 \ - core_file new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 \ + direct_file.h5 family_file000[0-3][0-9].h5 \ + new_family_v16_000[0-3][0-9].h5 multi_file-[rs].h5 core_file \ + new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 \ err_compat.h5 dtransform.h5 test_filters.h5 get_file_name.h5 \ tstint[1-2].h5 unlink_chunked.h5 btree2.h5 objcopy_src.h5 \ objcopy_dst.h5 objcopy_ext.dat trefer1.h5 trefer2.h5 \ @@ -731,8 +732,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -1090,7 +1091,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/test/dsets.c b/test/dsets.c index 2bb124f..13e22f5 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -106,6 +106,7 @@ const char *FILENAME[] = { #define DSET_DEPREC_NAME "deprecated" #define DSET_DEPREC_NAME_CHUNKED "deprecated_chunked" #define DSET_DEPREC_NAME_COMPACT "deprecated_compact" +#define DSET_DEPREC_NAME_FILTER "deprecated_filter" #define USER_BLOCK 1024 #define SIXTY_FOUR_KB 65536 @@ -114,6 +115,7 @@ const char *FILENAME[] = { #define H5Z_FILTER_BOGUS 305 #define H5Z_FILTER_CORRUPT 306 #define H5Z_FILTER_BOGUS2 307 +#define H5Z_FILTER_DEPREC 308 /* Flags for testing filters */ #define DISABLE_FLETCHER32 0 @@ -1032,7 +1034,7 @@ test_tconv(hid_t file) } /* This message derives from H5Z */ -const H5Z_class_t H5Z_BOGUS[1] = {{ +const H5Z_class2_t H5Z_BOGUS[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_BOGUS, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ @@ -1206,7 +1208,7 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts, } /* This message derives from H5Z */ -const H5Z_class_t H5Z_CORRUPT[1] = {{ +const H5Z_class2_t H5Z_CORRUPT[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_CORRUPT, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ @@ -4803,7 +4805,7 @@ test_types(hid_t file) } /* This message derives from H5Z */ -const H5Z_class_t H5Z_CAN_APPLY_TEST[1] = {{ +const H5Z_class2_t H5Z_CAN_APPLY_TEST[1] = {{ H5Z_CLASS_T_VERS, H5Z_FILTER_BOGUS, /* Filter id number */ 1, 1, @@ -5163,7 +5165,7 @@ error: /* This message derives from H5Z */ -const H5Z_class_t H5Z_SET_LOCAL_TEST[1] = {{ +const H5Z_class2_t H5Z_SET_LOCAL_TEST[1] = {{ H5Z_CLASS_T_VERS, H5Z_FILTER_BOGUS2, /* Filter id number */ 1, 1, @@ -6191,6 +6193,28 @@ error: } /* end test_random_chunks() */ #ifndef H5_NO_DEPRECATED_SYMBOLS +/* Empty can_apply and set_local callbacks */ +static herr_t +can_apply_deprec(hid_t UNUSED dcpl_id, hid_t UNUSED type_id, hid_t UNUSED space_id) +{ + return 1; +} + +static herr_t +set_local_deprec(hid_t UNUSED dcpl_id, hid_t UNUSED type_id, hid_t UNUSED space_id) +{ + return(SUCCEED); +} + +/* Old style H5Z_class_t, essentially a copy of the "bogus" filter */ +const H5Z_class1_t H5Z_DEPREC[1] = {{ + H5Z_FILTER_DEPREC, /* Filter id number */ + "deprec", /* Filter name for debugging */ + can_apply_deprec, /* The "can apply" callback */ + set_local_deprec, /* The "set local" callback */ + filter_bogus, /* The actual filter function */ +}}; + /*------------------------------------------------------------------------- * Function: test_deprec @@ -6208,8 +6232,9 @@ error: static herr_t test_deprec(hid_t file) { - hid_t dataset, space, small_space, create_parms; + hid_t dataset, space, small_space, create_parms, dcpl; hsize_t dims[2], small_dims[2]; + hsize_t deprec_size; herr_t status; hsize_t csize[2]; @@ -6363,6 +6388,16 @@ test_deprec(hid_t file) if((dataset = H5Dopen1(file, DSET_DEPREC_NAME_COMPACT)) < 0) goto error; if(H5Dclose(dataset) < 0) goto error; + /* Test H5Zregister with deprecated H5Z_class1_t */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk(dcpl, 2, csize) < 0) goto error; + if(H5Zregister(H5Z_DEPREC) < 0) goto error; + if(H5Pset_filter(dcpl, H5Z_FILTER_DEPREC, 0, (size_t)0, NULL) < 0) goto error; + + if(test_filter_internal(file,DSET_DEPREC_NAME_FILTER,dcpl,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deprec_size) < 0) goto error; + + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; diff --git a/test/dtransform.c b/test/dtransform.c index 8b5dce0..cb58a6c 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -50,17 +50,17 @@ const float windchillFfloat[ROWS][COLS] = const int transformData[ROWS][COLS] = { {36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, 28, 34, 40, 46, 52, 57, 63 }, - {34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 72 } , - {32, 25, 19, 13, 6, 0, 7, 13, 19, 26, 32, 39, 45, 51, 58, 64, 71, 77 }, - {30, 24, 17, 11, 4, 2, 9, 15, 22, 29, 35, 42, 48, 55, 61, 68, 74, 81 }, - {29, 23, 16, 9, 3, 4, 11, 17, 24, 31, 37, 44, 51, 58, 64, 71, 78, 84 }, - {28, 22, 15, 8, 1, 5, 12, 19, 26, 33, 39, 46, 53, 60, 67, 73, 80, 87 }, - {28, 21, 14, 7, 0, 7, 14, 21, 27, 34, 41, 48, 55, 62, 69, 76, 82, 89 }, - {27, 20, 13, 6, 1, 8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 78, 84, 91 }, - {26, 19, 12, 5, 2, 9, 16, 23, 30, 37, 44, 51, 58, 65, 72, 79, 86, 93 }, - {26, 19, 12, 4, 3, 10, 17, 24, 31, 38, 45, 52, 60, 67, 74, 81, 88, 95}, - {25, 18, 11, 4, 3, 11, 18, 25, 32, 39, 46, 54, 61, 68, 75, 82, 89, 97}, - {25, 17, 10, 3, 4, 11, 19, 26, 33, 40, 48, 55, 62, 69, 76, 84, 91, 98} + {34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 0 } , + {32, 25, 19, 13, 6, 0, 7, 13, 19, 26, 32, 39, 45, 51, 58, 64, 71, 5 }, + {30, 24, 17, 11, 4, 2, 9, 15, 22, 29, 35, 42, 48, 55, 61, 68, 2, 9 }, + {29, 23, 16, 9, 3, 4, 11, 17, 24, 31, 37, 44, 51, 58, 64, 71, 6, 12 }, + {28, 22, 15, 8, 1, 5, 12, 19, 26, 33, 39, 46, 53, 60, 67, 1, 8, 15 }, + {28, 21, 14, 7, 0, 7, 14, 21, 27, 34, 41, 48, 55, 62, 69, 4, 10, 17 }, + {27, 20, 13, 6, 1, 8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 6, 12, 19 }, + {26, 19, 12, 5, 2, 9, 16, 23, 30, 37, 44, 51, 58, 65, 0, 7, 14, 21 }, + {26, 19, 12, 4, 3, 10, 17, 24, 31, 38, 45, 52, 60, 67, 2, 9, 16, 23}, + {25, 18, 11, 4, 3, 11, 18, 25, 32, 39, 46, 54, 61, 68, 3, 10, 17, 25}, + {25, 17, 10, 3, 4, 11, 19, 26, 33, 40, 48, 55, 62, 69, 4, 12, 19, 26} }; #define UCOMPARE(TYPE,VAR1,VAR2,TOL) \ @@ -104,17 +104,25 @@ const int transformData[ROWS][COLS] = /* utrans is a transform for unsigned types: no negative numbers involved and results are < 255 to fit into uchar */ \ const char* utrans = "((x+100)/4)*3"; \ \ - hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset; \ + hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset, dset_nn, dt_nn; \ + H5T_order_t order; \ hsize_t dim[2] = {ROWS, COLS}; \ \ if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ - if((dset = H5Dcreate2(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; \ + if((dset = H5Dcreate2(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; \ + \ + if((dt_nn = H5Tcopy(HDF_TYPE)) < 0) TEST_ERROR \ + if((order = H5Tget_order(dt_nn)) == H5T_ORDER_ERROR) TEST_ERROR \ + if(H5Tset_order(dt_nn, order == H5T_ORDER_LE ? H5T_ORDER_BE : H5T_ORDER_LE) < 0) TEST_ERROR \ + if((dset_nn = H5Dcreate2(file_id, "/nonnative_transformtest_"TEST_STR, dt_nn, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR \ + if(H5Tclose(dt_nn) < 0) TEST_ERROR \ \ if(SIGNED) \ { \ if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_nn, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ } \ else \ @@ -122,6 +130,7 @@ const int transformData[ROWS][COLS] = if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_nn, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ } \ \ @@ -133,16 +142,21 @@ const int transformData[ROWS][COLS] = COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + \ + TESTING("contiguous, byte order conversion ("TEST_STR"->"TEST_STR")") \ + \ + if(H5Dread(dset_nn, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ + if(SIGNED) \ + COMPARE(TYPE, array, COMPARE_DATA, 2) \ + else \ + UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ \ if(SIGNED) \ { \ TESTING("contiguous, with type conversion (float->"TEST_STR")") \ \ if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ - if(SIGNED) \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ - else \ - UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + COMPARE(TYPE, array, COMPARE_DATA, 2) \ } \ \ if(H5Dclose(dset) < 0) TEST_ERROR; \ @@ -200,10 +214,7 @@ const int transformData[ROWS][COLS] = TESTING("chunked, with type conversion (float->"TEST_STR")") \ \ if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ - if(SIGNED) \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ - else \ - UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + COMPARE(TYPE, array, COMPARE_DATA, 2) \ } \ \ \ @@ -516,7 +527,7 @@ test_getset(const hid_t dxpl_id_c_to_f) float windchillFfloatread[ROWS][COLS]; const char* simple = "(4/2) * ( (2 + 4)/(5 - 2.5))"; /* this equals 4.8 */ const char* c_to_f = "(9/5.0)*x + 32"; - char* ptrgetTest = HDmalloc(HDstrlen(simple)+1); + char* ptrgetTest = (char *) HDmalloc(HDstrlen(simple)+1); TESTING("H5Pget_data_transform") H5Pget_data_transform(dxpl_id_c_to_f, ptrgetTest, HDstrlen(c_to_f)+1); @@ -549,7 +560,7 @@ test_getset(const hid_t dxpl_id_c_to_f) PASSED(); - ptrgetTest = malloc(strlen(simple)+1); + ptrgetTest = (char *) malloc(strlen(simple)+1); HDmemset(ptrgetTest, 0, strlen(simple)+1); TESTING("H5Pget_data_transform, after resetting transform property") @@ -577,7 +588,7 @@ test_set(void) hid_t dxpl_id; H5E_auto2_t func; const char* str = "(9/5.0)*x + 32"; - char* ptrgetTest = malloc(strlen(str)+1); + char* ptrgetTest = (char *) malloc(strlen(str)+1); if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; diff --git a/test/family_v16_00000.h5 b/test/family_v16_00000.h5 index bf1a711..ac75ea9 100644 Binary files a/test/family_v16_00000.h5 and b/test/family_v16_00000.h5 differ diff --git a/test/links.c b/test/links.c index c169670..1d64dd9 100644 --- a/test/links.c +++ b/test/links.c @@ -81,6 +81,7 @@ const char *FILENAME[] = { "extlinks18B", /* 41: */ "extlinks19A", /* 42: */ "extlinks19B", /* 43: */ + "extlinks20", /* 44: */ NULL }; @@ -131,6 +132,7 @@ const char *FILENAME[] = { "extlinks18B", /* 41: */ "extlinks19A", /* 42: */ "extlinks19B", /* 43: */ + "extlinks20", /* 44: */ NULL }; @@ -4218,8 +4220,8 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) if (H5Pset_fapl_family(fam_fapl, op_data.fam_size, op_data.base_fapl) < 0) TEST_ERROR /* Create parent and target files, group, and external link */ - h5_fixname(FILENAME[40], fapl, filename1, sizeof filename1); - h5_fixname(FILENAME[41], fam_fapl, filename2, sizeof filename2); + h5_fixname(FILENAME[42], fapl, filename1, sizeof filename1); + h5_fixname(FILENAME[43], fam_fapl, filename2, sizeof filename2); if ((file1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR if ((file2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fam_fapl)) < 0) TEST_ERROR if ((group = H5Gcreate2(file1, "group1",H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4297,6 +4299,67 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) } /* end external_set_elink_cb() */ +/*------------------------------------------------------------------------- + * Function: external_reset_register + * + * Purpose: Check that external links are registered after the library + * is reset. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Neil Fortner + * Apr. 9, 2009 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +external_reset_register(void) +{ + hid_t file; + char filename[NAME_BUF_SIZE]; + + TESTING("external links are registered after reset") + + /* Create and close file */ + h5_fixname(FILENAME[44], H5P_DEFAULT, filename, sizeof filename); + if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if (H5Fclose(file) < 0) TEST_ERROR + + /* Reset the library */ + H5close(); + + /* Re open file */ + if ((file = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Create an external link */ + if (H5Lcreate_external("some_file", "some_obj", file, "ext_link1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + + /* Close file */ + if (H5Fclose(file) < 0) TEST_ERROR + + /* Try again to make sure the previous H5Lcreate_external call does not + * affect the ability to reset */ + H5close(); + if ((file = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR + if (H5Lcreate_external("another_file", "another_obj", file, "ext_link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if (H5Fclose(file) < 0) TEST_ERROR + + if(HDremove(filename) != 0) TEST_ERROR + + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + H5Fclose(file); + } H5E_END_TRY; + return -1; +} /* end external_reset_register() */ + + #ifdef H5_HAVE_WINDOW_PATH /*------------------------------------------------------------------------- @@ -7177,6 +7240,14 @@ ud_link_errors(hid_t fapl, hbool_t new_format) if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) FAIL_STACK_ERROR + /* Try to create internally defined links with H5Lcreate_ud */ + H5E_BEGIN_TRY { + if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_HARD, NULL, 0, H5P_DEFAULT, H5P_DEFAULT) >= 0) + TEST_ERROR + if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_SOFT, "str", 4, H5P_DEFAULT, H5P_DEFAULT) >= 0) + TEST_ERROR + } H5E_END_TRY + /* Create a user-defined link to the group. */ strcpy(group_name, "/group"); if(H5Lcreate_ud(fid, "/ud_link", UD_CBFAIL_TYPE, &group_name, HDstrlen(group_name) + 1, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -12753,6 +12824,13 @@ main(void) /* Close 2nd FAPL */ H5Pclose(fapl2); + h5_cleanup(FILENAME, fapl); + + /* 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; + /* Results */ if(nerrors) { printf("***** %d LINK TEST%s FAILED! *****\n", @@ -12761,8 +12839,6 @@ main(void) } printf("All link tests passed.\n"); - h5_cleanup(FILENAME, fapl); - /* clean up tmp directory created by external link tests */ HDrmdir(TMPDIR); diff --git a/test/objcopy.c b/test/objcopy.c index c2d71c0..4bd4662 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -7451,6 +7451,10 @@ main(void) hid_t fcpl_src; hid_t fcpl_dst; + /* No need to test dense attributes with old format */ + if(!(configuration & CONFIG_NEW_FORMAT) && (configuration & CONFIG_DENSE)) + continue; + /* Test with and without shared messages */ if(configuration & CONFIG_SHARE_SRC) { puts("\nTesting with shared src messages:"); @@ -7473,22 +7477,23 @@ main(void) if(configuration & CONFIG_NEW_FORMAT) { puts("Testing with new group format:"); my_fapl = fapl2; + + /* Test with and without dense attributes */ + if(configuration & CONFIG_DENSE) { + puts("Testing with dense attributes:"); + num_attributes_g = max_compact + 1; + } + else { + puts("Testing without dense attributes:"); + num_attributes_g = MAX(min_dense, 2) - 1; + } } /* end if */ else { puts("Testing with old group format:"); my_fapl = fapl; + num_attributes_g = 4; } /* end else */ - /* Test with and without dense attributes */ - if(configuration & CONFIG_DENSE) { - puts("Testing with dense attributes:"); - num_attributes_g = max_compact + 1; - } - else { - puts("Testing without dense attributes:"); - num_attributes_g = MAX(min_dense, 2) - 1; - } - /* The tests... */ nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, my_fapl); nerrors += test_copy_dataset_simple_samefile(fcpl_src, my_fapl); diff --git a/test/tfile.c b/test/tfile.c index 724ad4a..68c7f6b 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -27,6 +27,14 @@ #include "H5Bprivate.h" #include "H5Pprivate.h" +/* + * This file needs to access private information from the H5F package. + * This file also needs to access the file testing code. + */ +#define H5F_PACKAGE +#define H5F_TESTING +#include "H5Fpkg.h" /* File access */ + #define F1_USERBLOCK_SIZE (hsize_t)0 #define F1_OFFSET_SIZE sizeof(haddr_t) #define F1_LENGTH_SIZE sizeof(hsize_t) @@ -1931,9 +1939,9 @@ test_userblock_file_size(void) /* Reopen files */ file1_id = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Fopen"); + CHECK(file1_id, FAIL, "H5Fopen"); file2_id = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Fopen"); + CHECK(file2_id, FAIL, "H5Fopen"); /* Check file sizes */ ret = H5Fget_filesize(file1_id, &filesize1); @@ -1952,9 +1960,9 @@ test_userblock_file_size(void) /* Reopen files */ file1_id = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Fopen"); + CHECK(file1_id, FAIL, "H5Fopen"); file2_id = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Fopen"); + CHECK(file2_id, FAIL, "H5Fopen"); /* Verify file sizes did not change */ ret = H5Fget_filesize(file1_id, &filesize); @@ -1973,6 +1981,52 @@ test_userblock_file_size(void) /**************************************************************** ** +** test_cached_stab_info(): low-level file test routine. +** This test checks that new files are created with cached +** symbol table information in the superblock (when using +** the old format). This is necessary to ensure backwards +** compatibility with versions from 1.3.0 to 1.6.3. +** +*****************************************************************/ +static void +test_cached_stab_info(void) +{ + hid_t file_id; + hid_t group_id; + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing cached symbol table information\n")); + + /* Create file */ + file_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(file_id, FAIL, "H5Fcreate"); + + /* Create group */ + group_id = H5Gcreate2(file_id, GROUP1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(group_id, FAIL, "H5Gcreate2"); + + /* Close file and group */ + ret = H5Gclose(group_id); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Fclose(file_id); + CHECK(ret, FAIL, "H5Fclose"); + + /* Reopen file */ + file_id = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Fopen"); + + /* Verify the cached symbol table information */ + ret = H5F_check_cached_stab_test(file_id); + CHECK(ret, FAIL, "H5F_check_cached_stab_test"); + + /* Close file */ + ret = H5Fclose(file_id); + CHECK(ret, FAIL, "H5Fclose"); +} /* end test_cached_stab_info() */ + +/**************************************************************** +** ** test_file(): Main low-level file I/O test routine. ** ****************************************************************/ @@ -2002,7 +2056,8 @@ test_file(void) test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */ test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */ #endif /*H5_CANNOT_OPEN_TWICE*/ - test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */ + test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */ + test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */ } /* test_file() */ diff --git a/test/tid.c b/test/tid.c index f3c00fc..9bb93e7 100644 --- a/test/tid.c +++ b/test/tid.c @@ -394,7 +394,7 @@ static int test_is_valid(void) /* Check that an id of -1 is invalid */ tri_ret = H5Iis_valid(-1); - VERIFY(tri_ret, FALSE, "H5Iis_valid"); + VERIFY(tri_ret, FALSE, "H4Iis_valid"); if (tri_ret != FALSE) goto out; @@ -408,6 +408,46 @@ out: return -1; } +/* Test the H5Iget_type function */ +static int test_get_type(void) +{ + hid_t dtype; /* datatype id */ + H5I_type_t type_ret; /* return value */ + + /* Create a datatype id */ + dtype = H5Tcopy(H5T_NATIVE_INT); + CHECK(dtype, FAIL, "H5Tcopy"); + if (dtype < 0) + goto out; + + /* Check that the ID is correct */ + type_ret = H5Iget_type(dtype); + VERIFY(type_ret, H5I_DATATYPE, "H5Iget_type"); + if (type_ret == H5I_BADID) + goto out; + + /* Check that the ID is correct */ + type_ret = H5Iget_type(H5T_STRING); + VERIFY(type_ret, H5I_BADID, "H5Iget_type"); + if (type_ret != H5I_BADID) + goto out; + + /* Check that the ID is correct */ + type_ret = H5Iget_type(-1); + VERIFY(type_ret, H5I_BADID, "H5Iget_type"); + if (type_ret != H5I_BADID) + goto out; + + H5Tclose(dtype); + + return 0; + +out: + if(dtype != H5I_INVALID_HID) + H5Tclose(dtype); + + return -1; +} /* Test boundary cases with lots of types */ @@ -498,6 +538,7 @@ void test_ids(void) if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n"); if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n"); if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n"); + if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n"); if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n"); } diff --git a/test/tmisc.c b/test/tmisc.c index 4db800c..b646a69 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3779,6 +3779,7 @@ test_misc23(void) tmp_id=0, create_id=H5P_DEFAULT, access_id=H5P_DEFAULT; char objname[MISC23_NAME_BUF_SIZE]; /* Name of object */ H5O_info_t oinfo; + htri_t tri_status; herr_t status; /* Output message about test being performed */ @@ -4022,6 +4023,87 @@ test_misc23(void) status = H5Pclose(create_id); CHECK(status, FAIL, "H5Pclose"); + /********************************************************************** + * test H5Lcopy() + **********************************************************************/ + + /* Create link creation property list */ + create_id = H5Pcreate(H5P_LINK_CREATE); + CHECK(create_id, FAIL, "H5Pcreate"); + + /* Set flag for intermediate group creation */ + status = H5Pset_create_intermediate_group(create_id, TRUE); + CHECK(status, FAIL, "H5Pset_create_intermediate_group"); + + status = H5Lcopy(file_id, "/A/B01/grp", file_id, "/A/B16/grp", create_id, access_id); + CHECK(status, FAIL, "H5Lcopy"); + + tri_status = H5Lexists(file_id, "/A/B16/grp", access_id); + VERIFY(tri_status, TRUE, "H5Lexists"); + + tri_status = H5Lexists(file_id, "/A/B01/grp", access_id); + VERIFY(tri_status, TRUE, "H5Lexists"); + + /********************************************************************** + * test H5Lmove() + **********************************************************************/ + + status = H5Lmove(file_id, "/A/B16/grp", file_id, "/A/B17/grp", create_id, access_id); + CHECK(status, FAIL, "H5Lmove"); + + tri_status = H5Lexists(file_id, "/A/B17/grp", access_id); + VERIFY(tri_status, TRUE, "H5Lexists"); + + tri_status = H5Lexists(file_id, "/A/B16/grp", access_id); + VERIFY(tri_status, FALSE, "H5Lexists"); + + /********************************************************************** + * test H5Lcreate_hard() + **********************************************************************/ + + status = H5Lcreate_hard(file_id, "/A/B01/grp", file_id, "/A/B18/grp", create_id, access_id); + CHECK(status, FAIL, "H5Lcreate_hard"); + + tri_status = H5Lexists(file_id, "/A/B18/grp", access_id); + VERIFY(tri_status, TRUE, "H5Lexists"); + + /********************************************************************** + * test H5Lcreate_soft() + **********************************************************************/ + + status = H5Lcreate_soft("/A/B01/grp", file_id, "/A/B19/grp", create_id, access_id); + CHECK(status, FAIL, "H5Lcreate_soft"); + + tri_status = H5Lexists(file_id, "/A/B19/grp", access_id); + VERIFY(tri_status, TRUE, "H5Lexists"); + + /********************************************************************** + * test H5Lcreate_external() + **********************************************************************/ + + status = H5Lcreate_external("fake_filename", "fake_path", file_id, "/A/B20/grp", create_id, access_id); + CHECK(status, FAIL, "H5Lcreate_external"); + + tri_status = H5Lexists(file_id, "/A/B20/grp", access_id); + VERIFY(tri_status, TRUE, "H5Lexists"); + + /********************************************************************** + * test H5Lcreate_ud() + **********************************************************************/ + + status = H5Lcreate_ud(file_id, "/A/B21/grp", H5L_TYPE_EXTERNAL, "file\0obj", (size_t) 9, create_id, access_id); + CHECK(status, FAIL, "H5Lcreate_ud"); + + tri_status = H5Lexists(file_id, "/A/B21/grp", access_id); + VERIFY(tri_status, TRUE, "H5Lexists"); + + /********************************************************************** + * close + **********************************************************************/ + + status = H5Pclose(create_id); + CHECK(status, FAIL, "H5Pclose"); + status = H5Gclose(group_id); CHECK(status, FAIL, "H5Gclose"); diff --git a/test/tskiplist.c b/test/tskiplist.c index 289df0b..7b3dcef 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -121,7 +121,7 @@ test_skiplist_create(void) MESSAGE(6, ("Testing Creating & Closing Skip Lists\n")); /* Try creating a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Try closing the skip list */ @@ -151,7 +151,7 @@ test_skiplist_insert(void) MESSAGE(7, ("Testing Insertion Into Skip List\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -212,7 +212,7 @@ test_skiplist_insert_many(void) MESSAGE(7, ("Testing Insertion of Many Items Into Skip List\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -286,7 +286,7 @@ test_skiplist_remove(void) MESSAGE(7, ("Testing Removal From Skip List\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -365,7 +365,7 @@ test_skiplist_remove_many(void) MESSAGE(7, ("Testing Removal of Many Items From Skip List\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -465,7 +465,7 @@ test_skiplist_firstnext(void) MESSAGE(7, ("Testing Iterating Over Skip List With First/Next\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -558,7 +558,7 @@ test_skiplist_string(void) MESSAGE(7, ("Testing Skip List With String Keys\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_STR); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -620,7 +620,7 @@ test_skiplist_iterate(void) MESSAGE(7, ("Testing Iterating Over Skip List\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -670,7 +670,7 @@ test_skiplist_hsize(void) MESSAGE(7, ("Testing Skip List With hsize_t Keys\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_HSIZE, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_HSIZE); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -725,7 +725,7 @@ test_skiplist_unsigned(void) MESSAGE(7, ("Testing Skip List With unsigned Keys\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_UNSIGNED); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -778,7 +778,7 @@ test_skiplist_lastprev(void) MESSAGE(7, ("Testing Iterating Over Skip List With Last/Prev\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -846,7 +846,7 @@ test_skiplist_find(void) MESSAGE(7, ("Testing Skip List 'Find' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_UNSIGNED); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -902,7 +902,7 @@ test_skiplist_add(void) MESSAGE(7, ("Testing Skip List 'Add' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_UNSIGNED); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -964,7 +964,7 @@ test_skiplist_destroy(void) MESSAGE(7, ("Testing Skip List 'Destroy' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1000,7 +1000,7 @@ test_skiplist_free(void) MESSAGE(7, ("Testing Skip List 'Free' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_INT); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1056,7 +1056,7 @@ test_skiplist_less(void) MESSAGE(7, ("Testing Skip List 'Less' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_UNSIGNED); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1120,7 +1120,7 @@ test_skiplist_greater(void) MESSAGE(7, ("Testing Skip List 'Greater' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_UNSIGNED); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1182,10 +1182,10 @@ test_skiplist_below(void) herr_t ret; /* Generic return value */ /* Output message about test being performed */ - MESSAGE(7, ("Testing Skip List 'Less' Operation\n")); + MESSAGE(7, ("Testing Skip List 'Below' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_UNSIGNED); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1261,10 +1261,10 @@ test_skiplist_above(void) herr_t ret; /* Generic return value */ /* Output message about test being performed */ - MESSAGE(7, ("Testing Skip List 'Greater' Operation\n")); + MESSAGE(7, ("Testing Skip List 'Above' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_UNSIGNED); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1338,10 +1338,10 @@ test_skiplist_remove_first(void) herr_t ret; /* Generic return value */ /* Output message about test being performed */ - MESSAGE(7, ("Testing Skip List 'Greater' Operation\n")); + MESSAGE(7, ("Testing Skip List 'Remove First' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED, 0.5, (size_t)16); + slist = H5SL_create(H5SL_TYPE_UNSIGNED); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1368,6 +1368,51 @@ test_skiplist_remove_first(void) /**************************************************************** ** +** test_skiplist_remote_first_many(): Test H5SL (skip list) code. +** Tests 'remove first' operation in large skip lists. +** +****************************************************************/ +static void +test_skiplist_remove_first_many(void) +{ + H5SL_t *slist; /* Skip list created */ + size_t u; /* Local index variable */ + int *found_item; /* Item found in skip list */ + int prev_item = INT_MIN; /* Previously found item in skip list */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(7, ("Testing Skip List 'Remove First' Operation\n")); + + /* Create a skip list */ + slist = H5SL_create(H5SL_TYPE_INT); + CHECK(slist, NULL, "H5SL_create"); + + /* Insert objects into the skip list */ + for(u = 0; u < NUM_ELEMS; u++) { + ret = H5SL_insert(slist, &rand_num[u], &rand_num[u]); + CHECK(ret, FAIL, "H5SL_insert"); + } /* end for */ + + /* Remove objects from the skip list */ + for(u = 0; u < NUM_ELEMS; u++) { + found_item = (int *)H5SL_remove_first(slist); + VERIFY(*found_item > prev_item, TRUE, "H5SL_remove_first"); + prev_item = *found_item; + } /* end for */ + + /* Check for removing object from empty list */ + found_item = (int *)H5SL_remove_first(slist); + VERIFY(found_item, NULL, "H5SL_remove_first"); + + /* Close the skip list */ + ret = H5SL_close(slist); + CHECK(ret, FAIL, "H5SL_close"); + +} /* end test_skiplist_remove_first() */ + +/**************************************************************** +** ** test_skiplist(): Main H5SL testing routine. ** ****************************************************************/ @@ -1401,6 +1446,7 @@ test_skiplist(void) test_skiplist_below(); /* Test 'below' operation */ test_skiplist_above(); /* Test 'above' operation */ test_skiplist_remove_first(); /* Test 'remove first' operation */ + test_skiplist_remove_first_many(); /* Test 'remove first' operation on large skip lists */ } /* end test_skiplist() */ diff --git a/test/vfd.c b/test/vfd.c index 57798a5..c1de28d 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -28,6 +28,7 @@ #define FAMILY_SIZE2 (5*KB) #define MULTI_SIZE 128 #define CORE_INCREMENT (4*KB) +#define FILE_COPY_BUF_SIZE 4096 /*Macros for Direct VFD*/ #define MBOUNDARY 512 @@ -44,6 +45,7 @@ const char *FILENAME[] = { "sec2_file", "core_file", "family_file", + "new_family_v16_", "multi_file", "direct_file", NULL @@ -173,7 +175,7 @@ test_direct(void) fapl = h5_fileaccess(); if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE) < 0) TEST_ERROR; - h5_fixname(FILENAME[4], fapl, filename, sizeof filename); + h5_fixname(FILENAME[5], fapl, filename, sizeof filename); /* Verify the file access properties */ if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize) < 0) @@ -805,8 +807,14 @@ test_family_compat(void) hid_t dset; char dname[]="dataset"; char filename[1024]; - char pathname[1024]; + char pathname[1024], pathname_individual[1024]; + char newname[1024], newname_individual[1024]; char *srcdir = getenv("srcdir"); /*where the src code is located*/ + FILE *tmp_fp, *old_fp; /* Pointers to temp & old files */ + void *copy_buf; /* Pointer to buffer for copying data */ + size_t written; /* Amount of data written to new file */ + size_t read_in; /* Amount of data read in from old file */ + int counter = 0; TESTING("FAMILY file driver backward compatibility"); @@ -817,6 +825,7 @@ test_family_compat(void) TEST_ERROR; h5_fixname(COMPAT_BASENAME, fapl, filename, sizeof filename); + h5_fixname(FILENAME[3], fapl, newname, sizeof newname); pathname[0] = '\0'; /* Generate correct name for test file by prepending the source path */ @@ -826,9 +835,42 @@ test_family_compat(void) } HDstrcat(pathname, filename); + /* The following code makes the copies of the family files in the source directory. + * Since we're going to open the files with write mode, this protects the original + * files. + */ + if(NULL == (copy_buf = HDmalloc((size_t)FILE_COPY_BUF_SIZE))) TEST_ERROR + + sprintf(newname_individual, newname, counter); + sprintf(pathname_individual, pathname, counter); + + /* Open the original files until no more left. Copy the content into the new files. */ + while((old_fp = HDfopen(pathname_individual,"rb"))) { + /* Open the new file */ + if(NULL == (tmp_fp = fopen(newname_individual,"wb"))) TEST_ERROR + + /* Copy data from the old file to the new file */ + while((read_in = HDfread(copy_buf, (size_t)1, (size_t)FILE_COPY_BUF_SIZE, old_fp)) > 0) + /* Write the data to the new file */ + if(read_in != (written = HDfwrite(copy_buf, (size_t)1, read_in, tmp_fp))) TEST_ERROR + + /* Close the old file */ + if(HDfclose(old_fp)) TEST_ERROR + + /* Close the new file */ + if(HDfclose(tmp_fp)) TEST_ERROR + + counter++; + sprintf(newname_individual, newname, counter); + sprintf(pathname_individual, pathname, counter); + } + + /* Free the copy buffer */ + free(copy_buf); + /* Make sure we can open the file. Use the read and write mode to flush the * superblock. */ - if((file = H5Fopen(pathname, H5F_ACC_RDWR, fapl)) < 0) + if((file = H5Fopen(newname, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; if((dset = H5Dopen2(file, dname, H5P_DEFAULT)) < 0) @@ -841,7 +883,7 @@ test_family_compat(void) TEST_ERROR; /* Open the file again to make sure it isn't corrupted. */ - if((file = H5Fopen(pathname, H5F_ACC_RDWR, fapl)) < 0) + if((file = H5Fopen(newname, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; if((dset = H5Dopen2(file, dname, H5P_DEFAULT)) < 0) @@ -853,8 +895,7 @@ test_family_compat(void) if(H5Fclose(file) < 0) TEST_ERROR; - if(H5Pclose(fapl) < 0) - TEST_ERROR; + h5_cleanup(FILENAME, fapl); PASSED(); @@ -863,6 +904,7 @@ test_family_compat(void) error: H5E_BEGIN_TRY { H5Fclose(file); + H5Pclose(fapl); } H5E_END_TRY; return -1; @@ -979,7 +1021,7 @@ test_multi(void) if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE) < 0) TEST_ERROR; - h5_fixname(FILENAME[3], fapl, filename, sizeof filename); + h5_fixname(FILENAME[4], fapl, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 9a275df..abfdf19 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -402,8 +402,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -508,7 +508,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index a0cf0e2..4c581f6 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -24,9 +24,9 @@ #include "testphdf5.h" static int mpi_size, mpi_rank; -#define DATASETNAME "ExtendibleArray" -#define CHUNKSIZE 1000 /* #elements per chunk */ -#define DSETCHUNKS 20000 +#define DSET_NAME "ExtendibleArray" +#define CHUNK_SIZE 1000 /* #elements per chunk */ +#define CHUNK_FACTOR 200 /* default dataset size in terms of chunks */ #define CLOSE 1 #define NO_CLOSE 0 @@ -78,12 +78,12 @@ typedef enum access_ { /* - * This creates a dataset serially with 'nchunks' chunks, each of CHUNKSIZE + * This creates a dataset serially with chunks, each of CHUNK_SIZE * elements. The allocation time is set to H5D_ALLOC_TIME_EARLY. Another * routine will open this in parallel for extension test. */ static void -create_chunked_dataset(const char *filename, int nchunks, write_type write_pattern) +create_chunked_dataset(const char *filename, int chunk_factor, write_type write_pattern) { hid_t file_id, dataset; /* handles */ hid_t dataspace,memspace; @@ -91,14 +91,14 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte hsize_t dims[1]; hsize_t maxdims[1] = {H5S_UNLIMITED}; - hsize_t chunk_dims[1] ={CHUNKSIZE}; + hsize_t chunk_dims[1] ={CHUNK_SIZE}; hsize_t count[1]; hsize_t stride[1]; hsize_t block[1]; hsize_t offset[1]; /* Selection offset within dataspace */ /* Variables used in reading data back */ - char buffer[CHUNKSIZE]; - + char buffer[CHUNK_SIZE]; + long nchunks; herr_t hrc; MPI_Offset filesize, /* actual file size */ @@ -110,8 +110,8 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte /* Only MAINPROCESS should create the file. Others just wait. */ if (MAINPROCESS){ - - dims[0]=nchunks*CHUNKSIZE; + nchunks=chunk_factor*mpi_size; + dims[0]=nchunks*CHUNK_SIZE; /* Create the data space with unlimited dimensions. */ dataspace = H5Screate_simple (1, dims, maxdims); VRFY((dataspace >= 0), ""); @@ -135,11 +135,11 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte VRFY((hrc >= 0), ""); /* Create a new dataset within the file using cparms creation properties. */ - dataset = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT); + dataset = H5Dcreate2(file_id, DSET_NAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT); VRFY((dataset >= 0), ""); if(write_pattern == sec_last) { - HDmemset(buffer, 100, CHUNKSIZE); + HDmemset(buffer, 100, CHUNK_SIZE); count[0] = 1; stride[0] = 1; @@ -174,7 +174,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte /* verify file size */ filesize = get_filesize(filename); - est_filesize = nchunks * CHUNKSIZE * sizeof(unsigned char); + est_filesize = nchunks * CHUNK_SIZE * sizeof(unsigned char); VRFY((filesize >= est_filesize), "file size check"); } @@ -190,12 +190,12 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte /* * This program performs three different types of parallel access. It writes on - * the entire dataset, it extends the dataset to nchunks*CHUNKSIZE, and it only + * the entire dataset, it extends the dataset to nchunks*CHUNK_SIZE, and it only * opens the dataset. At the end, it verifies the size of the dataset to be - * consistent with argument 'nchunks'. + * consistent with argument 'chunk_factor'. */ static void -parallel_access_dataset(const char *filename, int nchunks, access_type action, hid_t *file_id, hid_t *dataset) +parallel_access_dataset(const char *filename, int chunk_factor, access_type action, hid_t *file_id, hid_t *dataset) { /* HDF5 gubbins */ hid_t memspace, dataspace; /* HDF5 file identifier */ @@ -203,15 +203,18 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h herr_t hrc; /* HDF5 return code */ hsize_t size[1]; - hsize_t chunk_dims[1] ={CHUNKSIZE}; + hsize_t chunk_dims[1] ={CHUNK_SIZE}; hsize_t count[1]; hsize_t stride[1]; hsize_t block[1]; hsize_t offset[1]; /* Selection offset within dataspace */ + hsize_t dims[1]; + hsize_t maxdims[1]; + /* Variables used in reading data back */ - char buffer[CHUNKSIZE]; + char buffer[CHUNK_SIZE]; int i; - + long nchunks; /* MPI Gubbins */ MPI_Offset filesize, /* actual file size */ est_filesize; /* estimated file size */ @@ -220,6 +223,8 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + nchunks=chunk_factor*mpi_size; + /* Set up MPIO file access property lists */ access_plist = H5Pcreate(H5P_FILE_ACCESS); VRFY((access_plist >= 0), ""); @@ -235,7 +240,7 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h /* Open dataset*/ if (*dataset<0){ - *dataset = H5Dopen2(*file_id, DATASETNAME, H5P_DEFAULT); + *dataset = H5Dopen2(*file_id, DSET_NAME, H5P_DEFAULT); VRFY((*dataset >= 0), ""); } @@ -245,19 +250,18 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h dataspace = H5Dget_space(*dataset); VRFY((dataspace >= 0), ""); - size[0] = nchunks*CHUNKSIZE; + size[0] = nchunks*CHUNK_SIZE; switch (action) { /* all chunks are written by all the processes in an interleaved way*/ case write_all: - memset(buffer, mpi_rank+1, CHUNKSIZE); + memset(buffer, mpi_rank+1, CHUNK_SIZE); count[0] = 1; stride[0] = 1; block[0] = chunk_dims[0]; - for (i=0; i<(nchunks+mpi_size-1)/mpi_size; i++){ - if (i*mpi_size+mpi_rank < nchunks){ + for (i=0; i= 0), "H5Dwrite"); - } - } break; /* only extends the dataset */ case extend_only: - /* Extend dataset*/ - hrc = H5Dset_extent(*dataset, size); + /* check if new size is larger than old size */ + hrc = H5Sget_simple_extent_dims(dataspace, dims, maxdims); VRFY((hrc >= 0), ""); + /* Extend dataset*/ + if (size[0] > dims[0]) { + hrc = H5Dset_extent(*dataset, size); + VRFY((hrc >= 0), ""); + } break; - /* only opens the dataset */ + /* only opens the *dataset */ case open_only: break; @@ -292,10 +299,10 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h *dataset = -1; hrc = H5Sclose (dataspace); - VRFY((hrc >= 0), ""); + VRFY((hrc >= 0), ""); - hrc = H5Sclose (memspace); - VRFY((hrc >= 0), ""); + hrc = H5Sclose (memspace); + VRFY((hrc >= 0), ""); hrc = H5Fclose(*file_id); VRFY((hrc >= 0), ""); @@ -303,7 +310,7 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h /* verify file size */ filesize = get_filesize(filename); - est_filesize = nchunks*CHUNKSIZE*sizeof(unsigned char); + est_filesize = nchunks*CHUNK_SIZE*sizeof(unsigned char); VRFY((filesize >= est_filesize), "file size check"); /* Can close some plists */ @@ -326,27 +333,29 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h * interleaved pattern. */ static void -verify_data(const char *filename, int nchunks, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset) +verify_data(const char *filename, int chunk_factor, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset) { /* HDF5 gubbins */ hid_t dataspace, memspace; /* HDF5 file identifier */ hid_t access_plist; /* HDF5 ID for file access property list */ herr_t hrc; /* HDF5 return code */ - hsize_t chunk_dims[1] ={CHUNKSIZE}; + hsize_t chunk_dims[1] ={CHUNK_SIZE}; hsize_t count[1]; hsize_t stride[1]; hsize_t block[1]; hsize_t offset[1]; /* Selection offset within dataspace */ /* Variables used in reading data back */ - char buffer[CHUNKSIZE]; + char buffer[CHUNK_SIZE]; int value, i; int index; - + long nchunks; /* Initialize MPI */ MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + nchunks=chunk_factor*mpi_size; + /* Set up MPIO file access property lists */ access_plist = H5Pcreate(H5P_FILE_ACCESS); VRFY((access_plist >= 0), ""); @@ -362,7 +371,7 @@ verify_data(const char *filename, int nchunks, write_type write_pattern, int clo /* Open dataset*/ if (*dataset<0){ - *dataset = H5Dopen2(*file_id, DATASETNAME, H5P_DEFAULT); + *dataset = H5Dopen2(*file_id, DSET_NAME, H5P_DEFAULT); VRFY((*dataset >= 0), ""); } @@ -378,7 +387,7 @@ verify_data(const char *filename, int nchunks, write_type write_pattern, int clo block[0] = chunk_dims[0]; for (i=0; i\tfilename prefix\n"); printf("\t-2\t\tuse Split-file together with MPIO\n"); printf("\t-p\t\tuse combo MPI-POSIX driver\n"); - printf("\t-d \tdataset dimensions. Defaults (%d,%d)\n", - DIM0, DIM1); + printf("\t-d \tdataset dimensions factors. Defaults (%d,%d)\n", + ROW_FACTOR, COL_FACTOR); printf("\t-c \tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n"); printf("\n"); } @@ -138,6 +138,7 @@ parse_options(int argc, char **argv) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* setup default chunk-size. Make sure sizes are > 0 */ + chunkdim0 = (dim0+9)/10; chunkdim1 = (dim1+9)/10; @@ -184,9 +185,9 @@ parse_options(int argc, char **argv) nerrors++; return(1); } - dim0 = atoi(*(++argv)); + dim0 = atoi(*(++argv))*mpi_size; argc--; - dim1 = atoi(*(++argv)); + dim1 = atoi(*(++argv))*mpi_size; /* set default chunkdim sizes too */ chunkdim0 = (dim0+9)/10; chunkdim1 = (dim1+9)/10; @@ -325,6 +326,9 @@ int main(int argc, char **argv) MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + dim0 = ROW_FACTOR*mpi_size; + dim1 = COL_FACTOR*mpi_size; + if (MAINPROCESS){ printf("===================================\n"); printf("PHDF5 TESTS START\n"); @@ -367,7 +371,6 @@ int main(int argc, char **argv) "extendible dataset independent write #2", PARATESTFILE); AddTest("selnone", none_selection_chunk, NULL, "chunked dataset with none-selection", PARATESTFILE); - AddTest("calloc", test_chunk_alloc, NULL, "parallel extend Chunked allocation on serial file", PARATESTFILE); AddTest("fltread", test_filter_read, NULL, diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 81ad0f5..24c4432 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -36,6 +36,8 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, /* Constants definitions */ #define DIM0 600 /* Default dataset sizes. */ #define DIM1 1200 /* Values are from a monitor pixel sizes */ +#define ROW_FACTOR 8 /* Nominal row factor for dataset size */ +#define COL_FACTOR 16 /* Nominal column factor for dataset size */ #define RANK 2 #define DATASETNAME1 "Data1" #define DATASETNAME2 "Data2" diff --git a/tools/Makefile.in b/tools/Makefile.in index 5dc816f..113e752 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -350,8 +350,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -457,7 +457,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 3ea702b..958b30f 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -382,8 +382,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -490,7 +490,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index bf70681..b83d6ef 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -398,8 +398,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -511,7 +511,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 92e5493..b07c425 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -21,16 +21,16 @@ /*------------------------------------------------------------------------- - * Program: h5diffgentest - * - * Purpose: generate files for h5diff testing - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 12, 2003 - * - *------------------------------------------------------------------------- - */ +* Program: h5diffgentest +* +* Purpose: generate files for h5diff testing +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 12, 2003 +* +*------------------------------------------------------------------------- +*/ #define FILE1 "h5diff_basic1.h5" #define FILE2 "h5diff_basic2.h5" @@ -51,27 +51,27 @@ #define MY_LINKCLASS 187 /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(UNUSED const char * link_name, UNUSED hid_t cur_group, - UNUSED const void * udata, UNUSED size_t udata_size, UNUSED hid_t lapl_id) + UNUSED const void * udata, UNUSED size_t udata_size, UNUSED hid_t lapl_id) { -return -1; + return -1; } const H5L_class_t UD_link_class[1] = {{ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ - (H5L_type_t)MY_LINKCLASS, /* Link type id number */ - "UD link class", /* name for debugging */ - NULL, /* Creation callback */ - NULL, /* Move/rename callback */ - NULL, /* Copy callback */ - UD_traverse, /* The actual traversal function */ - NULL, /* Deletion callback */ - NULL /* Query callback */ + (H5L_type_t)MY_LINKCLASS, /* Link type id number */ + "UD link class", /* name for debugging */ + NULL, /* Creation callback */ + NULL, /* Move/rename callback */ + NULL, /* Copy callback */ + UD_traverse, /* The actual traversal function */ + NULL, /* Deletion callback */ + NULL /* Query callback */ }}; /*------------------------------------------------------------------------- - * prototypes - *------------------------------------------------------------------------- - */ +* prototypes +*------------------------------------------------------------------------- +*/ /* tests called in main() */ static int test_basic(const char *fname1, const char *fname2, const char *fname3); @@ -90,43 +90,43 @@ static int write_dset(hid_t loc_id,int rank,hsize_t *dims,const char *name,hid_t /*------------------------------------------------------------------------- - * Function: main - * - * Purpose: main program - * - *------------------------------------------------------------------------- - */ +* Function: main +* +* Purpose: main program +* +*------------------------------------------------------------------------- +*/ int main(void) { test_basic(FILE1, FILE2, FILE11); - + test_types (FILE3); test_datatypes(FILE4); - + /* generate 2 files, the second call creates a similar file with differences */ test_attributes(FILE5,0); test_attributes(FILE6,1); - + /* generate 2 files, the second call creates a similar file with differences */ test_datasets(FILE7,0); test_datasets(FILE8,1); - + /* generate 2 files, the second call creates a similar file with differences */ test_hyperslab(FILE9,0); test_hyperslab(FILE10,1); return 0; - + } /*------------------------------------------------------------------------- - * Function: test_basic - * - * Purpose: Create basic test files, first two contains different data, the - * third one is just an empty file. - * - *------------------------------------------------------------------------- - */ +* Function: test_basic +* +* Purpose: Create basic test files, first two contains different data, the +* third one is just an empty file. +* +*------------------------------------------------------------------------- +*/ static int test_basic(const char *fname1, const char *fname2, const char *fname3) @@ -135,7 +135,7 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) hid_t gid1, gid2, gid3; hsize_t dims1[1] = { 6 }; hsize_t dims2[2] = { 3,2 }; - + /* create the empty file */ if ((fid1=H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0){ fprintf(stderr, "empty file (%s) creation failed.\n", fname3); @@ -145,12 +145,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) fprintf(stderr, "empty file (%s) close failed.\n", fname3); goto out; } - + /*------------------------------------------------------------------------- * create two files *------------------------------------------------------------------------- */ - + if (( fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) goto out; if (( fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) @@ -164,7 +164,7 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) gid1 = H5Gcreate2(fid1, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); gid2 = H5Gcreate2(fid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); gid3 = H5Gcreate2(fid2, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - + /*------------------------------------------------------------------------- * tests: * # 1.1 normal mode @@ -174,19 +174,19 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) * # 1.5 with -d *------------------------------------------------------------------------- */ - + { double data1[3][2] = {{1,1}, {1,1}, {0,0}}; double data2[3][2] = {{0,1.1},{1.01,1.001},{0,1}}; double data3[3][2] = {{100,100},{100,100},{100,100}}; double data4[3][2] = {{105,120},{160,95},{80,40}}; - + write_dset(gid1,2,dims2,"dset1",H5T_NATIVE_DOUBLE,data1); write_dset(gid2,2,dims2,"dset2",H5T_NATIVE_DOUBLE,data2); write_dset(gid1,2,dims2,"dset3",H5T_NATIVE_DOUBLE,data3); write_dset(gid2,2,dims2,"dset4",H5T_NATIVE_DOUBLE,data4); write_dset(gid2,2,dims2,"dset1",H5T_NATIVE_DOUBLE,data2); - + } /*------------------------------------------------------------------------- * relative error, compare divide by zero, both zero @@ -196,12 +196,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) { int data5[3][2] = {{100,100},{100,0},{0,100}}; int data6[3][2] = {{120,80}, {0,100},{0,50}}; - + write_dset(gid1,2,dims2,"dset5",H5T_NATIVE_INT,data5); write_dset(gid1,2,dims2,"dset6",H5T_NATIVE_INT,data6); - + } - + /*------------------------------------------------------------------------- * relative error, compare divide by zero, both zero * # 1.6.2 with -p (unsigned long long) @@ -210,12 +210,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) { unsigned long long data7[3][2] = {{100,100},{100,0},{0,100}}; unsigned long long data8[3][2] = {{120,80}, {0,100},{0,50}}; - + write_dset(gid1,2,dims2,"dset7",H5T_NATIVE_ULLONG,data7); write_dset(gid1,2,dims2,"dset8",H5T_NATIVE_ULLONG,data8); - + } - + /*------------------------------------------------------------------------- * relative error, compare divide by zero, both zero * # 1.6.3 with -p (double) @@ -232,13 +232,13 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) { double data9[3][2] = {{100,100},{100,0},{0,100}}; double data10[3][2] ={{120,80}, {0,100},{0,50}}; - + write_dset(gid1,2,dims2,"dset9",H5T_NATIVE_DOUBLE,data9); write_dset(gid1,2,dims2,"dset10",H5T_NATIVE_DOUBLE,data10); - + } - - + + /*------------------------------------------------------------------------- * test floating point comparison *------------------------------------------------------------------------- @@ -249,86 +249,124 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) float data12[3][2] ={{0.00000f,0.00002f},{0.000009f,0.00001f},{0.00000f,0.00001f}}; double data13[3][2] ={{0.000000000,0.000000001},{0.000000001, 0.000000000},{0.000000001,0.000000001}}; double data14[3][2] ={{0.000000000,0.000000002},{0.0000000009,0.000000001},{0.000000000,0.000000001}}; - + write_dset(gid1,2,dims2,"fp1",H5T_NATIVE_FLOAT,data11); write_dset(gid1,2,dims2,"fp2",H5T_NATIVE_FLOAT,data12); write_dset(gid1,2,dims2,"d1",H5T_NATIVE_DOUBLE,data13); write_dset(gid1,2,dims2,"d2",H5T_NATIVE_DOUBLE,data14); - + } - - + + #if H5_SIZEOF_LONG_DOUBLE !=0 { - - /*------------------------------------------------------------------------- - * H5T_NATIVE_LDOUBLE - *------------------------------------------------------------------------- + + /*------------------------------------------------------------------------- + * H5T_NATIVE_LDOUBLE + *------------------------------------------------------------------------- */ - + long double data15[3][2] ={{1,1},{1,1},{1,1}}; - + write_dset(gid1,2,dims2,"ld",H5T_NATIVE_LDOUBLE,data15); - + } #endif - - - + + + /*------------------------------------------------------------------------- * NaNs in H5T_NATIVE_FLOAT *------------------------------------------------------------------------- */ { - + float data15[6]; float data16[6]; - + data15[0] = (float) sqrt( (double)-1 ); data15[1] = 1; data15[2] = (float) sqrt( (double)-1 ); data15[3] = 1; data15[4] = 1; data15[5] = 1; - + data16[0] = (float) sqrt( (double)-1 ); data16[1] = (float) sqrt( (double)-1 ); data16[2] = 1; data16[3] = 1; data16[4] = 1; data16[5] = 1; - + write_dset(gid1,1,dims1,"fp15",H5T_NATIVE_FLOAT,data15); write_dset(gid1,1,dims1,"fp16",H5T_NATIVE_FLOAT,data16); - + } - + /*------------------------------------------------------------------------- * NaNs in H5T_NATIVE_DOUBLE *------------------------------------------------------------------------- */ { - + double data17[6]; double data18[6]; - + data17[0] = sqrt( (double)-1 ); data17[1] = 1; data17[2] = sqrt( (double)-1 ); data17[3] = 1; data17[4] = 1; data17[5] = 1; - + data18[0] = (float) sqrt( (double)-1 ); data18[1] = (float) sqrt( (double)-1 ); data18[2] = 1; data18[3] = 1; data18[4] = 1; data18[5] = 1; - + write_dset(gid1,1,dims1,"fp17",H5T_NATIVE_DOUBLE,data17); write_dset(gid1,1,dims1,"fp18",H5T_NATIVE_DOUBLE,data18); - + + } + + /*------------------------------------------------------------------------- + * NaNs in H5T_NATIVE_DOUBLE and H5T_NATIVE_FLOAT inside H5T_COMPOUND + *------------------------------------------------------------------------- + */ + { + typedef struct cmp1_t + { + double d; + float f; + } cmp1_t; + + cmp1_t buf1[2]; + cmp1_t buf2[2]; + hsize_t dims[1] = {2}; + size_t type_size; + hid_t tid; + + buf1[0].d = sqrt( (double)-1 ); + buf1[0].f = (float) sqrt( (double)-1 ); + buf2[0].d = sqrt( (double)-1 ); + buf2[0].f = (float) sqrt( (double)-1 ); + + buf1[1].d = sqrt( (double)-1 ); + buf1[1].f = (float) sqrt( (double)-1 ); + buf2[1].d = 0; + buf2[1].f = 0; + + type_size = sizeof( cmp1_t ); + tid = H5Tcreate (H5T_COMPOUND, type_size ); + H5Tinsert(tid, "d", HOFFSET( cmp1_t, d ), H5T_NATIVE_DOUBLE ); + H5Tinsert(tid, "f", HOFFSET( cmp1_t, f ), H5T_NATIVE_FLOAT ); + write_dset(gid1,1,dims,"dset11",tid,buf1); + write_dset(gid1,1,dims,"dset12",tid,buf2); + H5Tclose(tid); + + } /* not comparable objects */ @@ -336,19 +374,19 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) typedef struct cmp1_t { - double d; - int i; + double d; + int i; } cmp1_t; typedef struct cmp2_t { - int i; - double d; + int i; + double d; } cmp2_t; typedef struct cmp3_t { - int i; + int i; } cmp3_t; double data2[6] = {0,0,0,0,0,0}; @@ -363,7 +401,7 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) size_t type_size; hid_t tid; - + write_dset(gid3,1,dims1,"dset1",H5T_NATIVE_DOUBLE,NULL); write_dset(gid3,1,dims1,"dset2",H5T_NATIVE_DOUBLE,data2); @@ -393,10 +431,10 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT ); write_dset(gid3,1,dims4,"dset9",tid,NULL); H5Tclose(tid); - + } - - + + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- @@ -407,21 +445,21 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) H5Fclose(fid1); H5Fclose(fid2); return SUCCEED; - + out: - + return FAIL; } /*------------------------------------------------------------------------- - * Function: test_types - * - * Purpose: Compare different HDF5 object & link types: - * H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK, H5G_UDLINK - * - *------------------------------------------------------------------------- - */ +* Function: test_types +* +* Purpose: Compare different HDF5 object & link types: +* H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK, H5G_UDLINK +* +*------------------------------------------------------------------------- +*/ static int test_types(const char *fname) { @@ -441,19 +479,19 @@ int test_types(const char *fname) { int a; } s2_t; - + /*------------------------------------------------------------------------- * Create one file *------------------------------------------------------------------------- */ fid1 = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - + /*------------------------------------------------------------------------- * H5G_DATASET *------------------------------------------------------------------------- */ write_dset(fid1,1,dims,"dset",H5T_NATIVE_INT,0); - + /*------------------------------------------------------------------------- * H5G_GROUP *------------------------------------------------------------------------- @@ -462,12 +500,12 @@ int test_types(const char *fname) status = H5Gclose(gid1); gid2 = H5Gcreate2(fid1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Gclose(gid2); - + /*------------------------------------------------------------------------- * H5G_TYPE *------------------------------------------------------------------------- */ - + /* create and commit datatype 1 */ tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)); H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT); @@ -479,15 +517,15 @@ int test_types(const char *fname) H5Tinsert(tid2, "a", HOFFSET(s2_t, a), H5T_NATIVE_INT); H5Tcommit2(fid1, "t2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Tclose(tid2); - + /*------------------------------------------------------------------------- * H5G_LINK *------------------------------------------------------------------------- */ - + status = H5Lcreate_soft("g1", fid1, "l1", H5P_DEFAULT, H5P_DEFAULT); status = H5Lcreate_soft("g2", fid1, "l2", H5P_DEFAULT, H5P_DEFAULT); - + /*------------------------------------------------------------------------- * H5G_UDLINK *------------------------------------------------------------------------- @@ -495,7 +533,7 @@ int test_types(const char *fname) H5Lcreate_external("filename", "objname", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); H5Lregister(UD_link_class); H5Lcreate_ud(fid1, "ud_link", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT); - + /*------------------------------------------------------------------------- * Close *------------------------------------------------------------------------- @@ -544,16 +582,16 @@ TOOLTEST h5diff_28.txt file3.h5 file3.h5 -v l1 l2 */ /*------------------------------------------------------------------------- - * Function: test_datatypes - * - * Purpose: test dataset datatypes - * - *------------------------------------------------------------------------- - */ +* Function: test_datatypes +* +* Purpose: test dataset datatypes +* +*------------------------------------------------------------------------- +*/ static int test_datatypes(const char *fname) { - + hid_t fid1; hsize_t dims[2]={3,2}; herr_t status; @@ -569,114 +607,114 @@ int test_datatypes(const char *fname) float buf5b[3][2] = {{1,1},{3,4},{5,6}}; double buf6a[3][2] = {{1,1},{1,1},{1,1}}; double buf6b[3][2] = {{1,1},{3,4},{5,6}}; - + /*unsigned/signed test signed char -128 to 127 unsigned char 0 to 255 */ char buf7a[3][2] = {{-1,-128},{-1,-1},{-1,-1}}; unsigned char buf7b[3][2] = {{1,128},{1,1},{1,1}}; - + /* long long test */ long long buf8a[3][2] = {{1,1},{1,1},{1,1}}; long long buf8b[3][2] = {{1,1},{3,4},{5,6}}; unsigned long long buf9a[3][2] = {{1,1},{1,1},{1,1}}; unsigned long long buf9b[3][2] = {{1,1},{3,4},{5,6}}; - + unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}}; unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}}; - - + + /*------------------------------------------------------------------------- * Create a file *------------------------------------------------------------------------- */ fid1 = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - + /*------------------------------------------------------------------------- * Check for different storage order. Give a warning if they are different *------------------------------------------------------------------------- */ - + write_dset(fid1,2,dims,"dset0a",H5T_STD_I16LE,buf2a); write_dset(fid1,2,dims,"dset0b",H5T_STD_I32LE,buf3b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_CHAR *------------------------------------------------------------------------- */ write_dset(fid1,2,dims,"dset1a",H5T_NATIVE_CHAR,buf1a); write_dset(fid1,2,dims,"dset1b",H5T_NATIVE_CHAR,buf1b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_SHORT *------------------------------------------------------------------------- */ write_dset(fid1,2,dims,"dset2a",H5T_NATIVE_SHORT,buf2a); write_dset(fid1,2,dims,"dset2b",H5T_NATIVE_SHORT,buf2b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_INT *------------------------------------------------------------------------- */ write_dset(fid1,2,dims,"dset3a",H5T_NATIVE_INT,buf3a); write_dset(fid1,2,dims,"dset3b",H5T_NATIVE_INT,buf3b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_LONG *------------------------------------------------------------------------- */ write_dset(fid1,2,dims,"dset4a",H5T_NATIVE_LONG,buf4a); write_dset(fid1,2,dims,"dset4b",H5T_NATIVE_LONG,buf4b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_FLOAT *------------------------------------------------------------------------- */ write_dset(fid1,2,dims,"dset5a",H5T_NATIVE_FLOAT,buf5a); write_dset(fid1,2,dims,"dset5b",H5T_NATIVE_FLOAT,buf5b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_DOUBLE *------------------------------------------------------------------------- */ - + write_dset(fid1,2,dims,"dset6a",H5T_NATIVE_DOUBLE,buf6a); write_dset(fid1,2,dims,"dset6b",H5T_NATIVE_DOUBLE,buf6b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_CHAR and H5T_NATIVE_UCHAR *------------------------------------------------------------------------- */ - + write_dset(fid1,2,dims,"dset7a",H5T_NATIVE_CHAR,buf7a); write_dset(fid1,2,dims,"dset7b",H5T_NATIVE_UCHAR,buf7b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_LLONG *------------------------------------------------------------------------- */ - + write_dset(fid1,2,dims,"dset8a",H5T_NATIVE_LLONG,buf8a); write_dset(fid1,2,dims,"dset8b",H5T_NATIVE_LLONG,buf8b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_ULLONG *------------------------------------------------------------------------- */ - + write_dset(fid1,2,dims,"dset9a",H5T_NATIVE_ULLONG,buf9a); write_dset(fid1,2,dims,"dset9b",H5T_NATIVE_ULLONG,buf9b); - + /*------------------------------------------------------------------------- * H5T_NATIVE_INT *------------------------------------------------------------------------- */ - + write_dset(fid1,2,dims,"dset10a",H5T_NATIVE_UINT,buf10a); write_dset(fid1,2,dims,"dset10b",H5T_NATIVE_UINT,buf10b); - - + + /*------------------------------------------------------------------------- * Close *------------------------------------------------------------------------- @@ -719,12 +757,12 @@ TOOLTEST h5diff_58.txt file7.h5 file8.h5 -v refreg */ /*------------------------------------------------------------------------- - * Function: test_attributes - * - * Purpose: test attributes - * - *------------------------------------------------------------------------- - */ +* Function: test_attributes +* +* Purpose: test attributes +* +*------------------------------------------------------------------------- +*/ static int test_attributes(const char *file, int make_diffs /* flag to modify data buffers */) @@ -736,31 +774,31 @@ int test_attributes(const char *file, hid_t sid; hsize_t dims[1]={2}; herr_t status; - + /* Create a file */ if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; - + /* Create a 1D dataset */ sid = H5Screate_simple(1, dims, NULL); did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Sclose(sid); assert(status >= 0); - + /* Create groups */ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); root_id = H5Gopen2(fid, "/", H5P_DEFAULT); - + /*------------------------------------------------------------------------- * write a series of attributes on the dataset, group, and root group *------------------------------------------------------------------------- */ - + write_attr_in(did,"dset",fid,make_diffs); write_attr_in(gid,NULL,0,make_diffs); write_attr_in(root_id,NULL,0,make_diffs); - - + + /* Close */ status = H5Dclose(did); assert(status >= 0); @@ -768,7 +806,7 @@ int test_attributes(const char *file, assert(status >= 0); status = H5Gclose(root_id); assert(status >= 0); - + /* Close file */ status = H5Fclose(fid); assert(status >= 0); @@ -777,15 +815,15 @@ int test_attributes(const char *file, /*------------------------------------------------------------------------- - * Function: test_datasets - * - * Purpose: Check all HDF5 classes - * H5T_INTEGER, H5T_FLOAT - * H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, - * H5T_ENUM, H5T_VLEN, H5T_ARRAY - * - *------------------------------------------------------------------------- - */ +* Function: test_datasets +* +* Purpose: Check all HDF5 classes +* H5T_INTEGER, H5T_FLOAT +* H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, +* H5T_ENUM, H5T_VLEN, H5T_ARRAY +* +*------------------------------------------------------------------------- +*/ static int test_datasets(const char *file, int make_diffs /* flag to modify data buffers */) @@ -797,37 +835,37 @@ int test_datasets(const char *file, hsize_t dims[1]={2}; herr_t status; int buf[2]={1,2}; - + if(make_diffs) memset(buf, 0, sizeof buf); - + /* Create a file */ if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; - + /* Create a 1D dataset */ sid = H5Screate_simple(1, dims, NULL); did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); status = H5Sclose(sid); assert(status >= 0); - + /* Create a group */ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - + /*------------------------------------------------------------------------- * write a series of datasets on the group *------------------------------------------------------------------------- */ - + write_dset_in(gid,"/dset",fid,make_diffs); - + /* close */ status = H5Dclose(did); assert(status >= 0); status = H5Gclose(gid); assert(status >= 0); - + /* close file */ status = H5Fclose(fid); assert(status >= 0); @@ -835,12 +873,12 @@ int test_datasets(const char *file, } /*------------------------------------------------------------------------- - * Function: write_attr_in - * - * Purpose: write attributes in LOC_ID (dataset, group, named datatype) - * - *------------------------------------------------------------------------- - */ +* Function: write_attr_in +* +* Purpose: write attributes in LOC_ID (dataset, group, named datatype) +* +*------------------------------------------------------------------------- +*/ static void write_attr_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ @@ -853,20 +891,20 @@ void write_attr_in(hid_t loc_id, char a; double b; } s_t; - + typedef enum { RED, - GREEN + GREEN } e_t; - + hid_t aid; hid_t sid; hid_t tid; herr_t status; int val, i, j, k, l, n; float f; - + /* create 1D attributes with dimension [2], 2 elements */ hsize_t dims[1]={2}; char buf1[2][STR_SIZE]= {"ab","de"}; /* string */ @@ -880,7 +918,7 @@ void write_attr_in(hid_t loc_id, int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ int buf7[2]= {1,2}; /* integer */ float buf8[2]= {1,2}; /* float */ - + /* create 2D attributes with dimension [3][2], 6 elements */ hsize_t dims2[2]={3,2}; char buf12[3][2][STR_SIZE]= {{"ab","cd"},{"ef","gh"},{"ij","kl"}}; /* string */ @@ -893,7 +931,7 @@ void write_attr_in(hid_t loc_id, int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ - + /* create 3D attributes with dimension [4][3][2], 24 elements */ hsize_t dims3[3]={4,3,2}; char buf13[4][3][2][STR_SIZE]= {{{"ab","cd"},{"ef","gh"},{"ij","kl"}}, @@ -909,18 +947,18 @@ void write_attr_in(hid_t loc_id, int buf63[24][3]; /* array */ int buf73[4][3][2]; /* integer */ float buf83[4][3][2]; /* float */ - - + + /*------------------------------------------------------------------------- * 1D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -947,19 +985,19 @@ void write_attr_in(hid_t loc_id, status = H5Tset_size(tid, (size_t)STR_SIZE); write_attr(loc_id,1,dims,"string",tid,buf1); status = H5Tclose(tid); - + for (i=0; i<2; i++) buf1a[i]=buf1[i]; tid = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid, H5T_VARIABLE); write_attr(loc_id,1,dims,"VLstring",tid,buf1a); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -976,16 +1014,16 @@ void write_attr_in(hid_t loc_id, [ 0 ] 1 0 1 [ 1 ] 2 0 2 */ - + tid = H5Tcopy(H5T_STD_B8LE); write_attr(loc_id,1,dims,"bitfield",tid,buf2); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - + /* buf2[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -997,17 +1035,17 @@ void write_attr_in(hid_t loc_id, [ 0 ] 1 0 1 [ 1 ] 2 0 2 */ - + tid = H5Tcreate(H5T_OPAQUE, (size_t)1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ write_attr(loc_id,1,dims,"opaque",tid,buf2); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -1015,7 +1053,7 @@ void write_attr_in(hid_t loc_id, buf3[i].a=0; buf3[i].b=0; } } - + /* buf3[2]= {{1,2},{3,4}}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -1028,13 +1066,13 @@ void write_attr_in(hid_t loc_id, [ 1 ] 3 5 2 [ 1 ] 4 5 1 */ - + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,1,dims,"compound",tid,buf3); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_REFERENCE (H5R_OBJECT object reference) *------------------------------------------------------------------------- @@ -1046,7 +1084,7 @@ void write_attr_in(hid_t loc_id, status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); } - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- @@ -1073,14 +1111,14 @@ void write_attr_in(hid_t loc_id, H5Tenum_insert(tid, "GREEN", (val = 1, &val)); write_attr(loc_id,1,dims,"enum",tid,buf45); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ - + buf5[0].len = 1; buf5[0].p = malloc( 1 * sizeof(int)); ((int *)buf5[0].p)[0]=1; @@ -1088,7 +1126,7 @@ void write_attr_in(hid_t loc_id, buf5[1].p = malloc( 2 * sizeof(int)); ((int *)buf5[1].p)[0]=2; ((int *)buf5[1].p)[1]=3; - + if (make_diffs) { ((int *)buf5[0].p)[0]=0; @@ -1104,7 +1142,7 @@ void write_attr_in(hid_t loc_id, [ 1 ] 2 0 2 [ 1 ] 3 0 3 */ - + sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); @@ -1115,12 +1153,12 @@ void write_attr_in(hid_t loc_id, status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); - + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -1146,12 +1184,12 @@ void write_attr_in(hid_t loc_id, tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_attr(loc_id, 1, dims, "array", tid, buf6); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -1176,13 +1214,13 @@ void write_attr_in(hid_t loc_id, */ write_attr(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); write_attr(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); - - + + /*------------------------------------------------------------------------- * 2D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -1194,7 +1232,7 @@ void write_attr_in(hid_t loc_id, for (k=0; k<2; k++) buf12[i][j][k]='z'; } - + /* buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -1214,17 +1252,17 @@ void write_attr_in(hid_t loc_id, [ 2 1 ] k z [ 2 1 ] l z */ - + tid = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid, (size_t)STR_SIZE); write_attr(loc_id,2,dims2,"string2D",tid,buf12); status = H5Tclose(tid); - + for (i=0; i<3; i++) { for (j=0; j<2; j++) { - + buf12a[i][j]=buf12[i][j]; } } @@ -1232,17 +1270,17 @@ void write_attr_in(hid_t loc_id, status = H5Tset_size(tid, H5T_VARIABLE); write_attr(loc_id,2,dims2,"VLstring2D",tid,buf12a); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf22,0,sizeof buf22); } - + /* buf22[3][2]= {{1,2},{3,4},{5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -1256,17 +1294,17 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 */ - - + + tid = H5Tcopy(H5T_STD_B8LE); write_attr(loc_id,2,dims2,"bitfield2D",tid,buf22); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - + /* buf22[3][2]= {{1,2},{3,4},{5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -1284,7 +1322,7 @@ void write_attr_in(hid_t loc_id, status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ write_attr(loc_id,2,dims2,"opaque2D",tid,buf22); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- @@ -1293,7 +1331,7 @@ void write_attr_in(hid_t loc_id, { memset(buf32,0,sizeof buf32); } - + /* buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -1307,14 +1345,14 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 */ - - + + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,2,dims2,"compound2D",tid,buf32); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_REFERENCE (H5R_OBJECT object reference) *------------------------------------------------------------------------- @@ -1329,7 +1367,7 @@ void write_attr_in(hid_t loc_id, } write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); } - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- @@ -1341,7 +1379,7 @@ void write_attr_in(hid_t loc_id, if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; } } - + /* Attribute: and position enum2D of enum2D of difference @@ -1353,18 +1391,18 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] RED GREEN [ 2 1 ] RED GREEN */ - + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); write_attr(loc_id,2,dims2,"enum2D",tid,buf452); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 3; i++) { @@ -1376,7 +1414,7 @@ void write_attr_in(hid_t loc_id, else ((int *)buf52[i][j].p)[l] = n++; } } - + /* position vlen2D of vlen2D of difference ------------------------------------------------------------ @@ -1392,7 +1430,7 @@ void write_attr_in(hid_t loc_id, [ 2 1 ] 10 0 10 [ 2 1 ] 11 0 11 */ - + sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); @@ -1403,12 +1441,12 @@ void write_attr_in(hid_t loc_id, status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); - + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf62,0,sizeof buf62); @@ -1442,12 +1480,12 @@ void write_attr_in(hid_t loc_id, tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_attr(loc_id, 2, dims2, "array2D", tid, buf62); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf72,0,sizeof buf72); @@ -1474,21 +1512,21 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 */ - + write_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); write_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - - + + /*------------------------------------------------------------------------- * 3D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<4; i++) @@ -1497,69 +1535,69 @@ void write_attr_in(hid_t loc_id, for (l=0; l<2; l++) buf13[i][j][k][l]='z'; } - + /* buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", "rs","tu","vw","xz","AB","CD","EF","GH", "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; - - Attribute: and - position string3D of string3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] a z - [ 0 0 0 ] b z - [ 0 0 1 ] c z - [ 0 0 1 ] d z - [ 0 1 0 ] e z - [ 0 1 0 ] f z - [ 0 1 1 ] g z - [ 0 1 1 ] h z - [ 0 2 0 ] i z - [ 0 2 0 ] j z - [ 0 2 1 ] k z - [ 0 2 1 ] l z - [ 1 0 0 ] m z - [ 1 0 0 ] n z - [ 1 0 1 ] p z - [ 1 0 1 ] q z - [ 1 1 0 ] r z - [ 1 1 0 ] s z - [ 1 1 1 ] t z - [ 1 1 1 ] u z - [ 1 2 0 ] v z - [ 1 2 0 ] w z - [ 1 2 1 ] x z - [ 2 0 0 ] A z - [ 2 0 0 ] B z - [ 2 0 1 ] C z - [ 2 0 1 ] D z - [ 2 1 0 ] E z - [ 2 1 0 ] F z - [ 2 1 1 ] G z - [ 2 1 1 ] H z - [ 2 2 0 ] I z - [ 2 2 0 ] J z - [ 2 2 1 ] K z - [ 2 2 1 ] L z - [ 3 0 0 ] M z - [ 3 0 0 ] N z - [ 3 0 1 ] P z - [ 3 0 1 ] Q z - [ 3 1 0 ] R z - [ 3 1 0 ] S z - [ 3 1 1 ] T z - [ 3 1 1 ] U z - [ 3 2 0 ] V z - [ 3 2 0 ] W z - [ 3 2 1 ] X z - [ 3 2 1 ] Z z - */ - + + Attribute: and + position string3D of string3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] a z + [ 0 0 0 ] b z + [ 0 0 1 ] c z + [ 0 0 1 ] d z + [ 0 1 0 ] e z + [ 0 1 0 ] f z + [ 0 1 1 ] g z + [ 0 1 1 ] h z + [ 0 2 0 ] i z + [ 0 2 0 ] j z + [ 0 2 1 ] k z + [ 0 2 1 ] l z + [ 1 0 0 ] m z + [ 1 0 0 ] n z + [ 1 0 1 ] p z + [ 1 0 1 ] q z + [ 1 1 0 ] r z + [ 1 1 0 ] s z + [ 1 1 1 ] t z + [ 1 1 1 ] u z + [ 1 2 0 ] v z + [ 1 2 0 ] w z + [ 1 2 1 ] x z + [ 2 0 0 ] A z + [ 2 0 0 ] B z + [ 2 0 1 ] C z + [ 2 0 1 ] D z + [ 2 1 0 ] E z + [ 2 1 0 ] F z + [ 2 1 1 ] G z + [ 2 1 1 ] H z + [ 2 2 0 ] I z + [ 2 2 0 ] J z + [ 2 2 1 ] K z + [ 2 2 1 ] L z + [ 3 0 0 ] M z + [ 3 0 0 ] N z + [ 3 0 1 ] P z + [ 3 0 1 ] Q z + [ 3 1 0 ] R z + [ 3 1 0 ] S z + [ 3 1 1 ] T z + [ 3 1 1 ] U z + [ 3 2 0 ] V z + [ 3 2 0 ] W z + [ 3 2 1 ] X z + [ 3 2 1 ] Z z + */ + tid = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid, (size_t)STR_SIZE); write_attr(loc_id,3,dims3,"string3D",tid,buf13); status = H5Tclose(tid); - + for (i=0; i<4; i++) { for (j=0; j<3; j++) @@ -1574,12 +1612,12 @@ void write_attr_in(hid_t loc_id, status = H5Tset_size(tid, H5T_VARIABLE); write_attr(loc_id,3,dims3,"VLstring3D",tid,buf13a); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - + n=1; for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { @@ -1589,7 +1627,7 @@ void write_attr_in(hid_t loc_id, } } } - + /* position bitfield3D of bitfield3D of difference ------------------------------------------------------------ @@ -1618,11 +1656,11 @@ void write_attr_in(hid_t loc_id, [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 */ - + tid = H5Tcopy(H5T_STD_B8LE); write_attr(loc_id,3,dims3,"bitfield3D",tid,buf23); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- @@ -1631,12 +1669,12 @@ void write_attr_in(hid_t loc_id, status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ write_attr(loc_id,3,dims3,"opaque3D",tid,buf23); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- */ - + n=1; for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { @@ -1703,13 +1741,13 @@ void write_attr_in(hid_t loc_id, [ 3 2 1 ] 47 0 47 [ 3 2 1 ] 48 0 48 */ - + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,3,dims3,"compound3D",tid,buf33); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_REFERENCE (H5R_OBJECT object reference) *------------------------------------------------------------------------- @@ -1725,12 +1763,12 @@ void write_attr_in(hid_t loc_id, } write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); } - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ - + for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) { @@ -1738,7 +1776,7 @@ void write_attr_in(hid_t loc_id, } } } - + /* position enum3D of enum3D of difference ------------------------------------------------------------ @@ -1767,19 +1805,19 @@ void write_attr_in(hid_t loc_id, [ 3 2 0 ] GREEN RED [ 3 2 1 ] GREEN RED */ - - + + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); write_attr(loc_id,3,dims3,"enum3D",tid,buf453); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 4; i++) { @@ -1818,7 +1856,7 @@ void write_attr_in(hid_t loc_id, status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); - + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- @@ -1842,11 +1880,11 @@ void write_attr_in(hid_t loc_id, [ 0 1 0 ] 7 0 7 etc */ - + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_attr(loc_id, 3, dims3, "array3D", tid, buf63); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- @@ -1866,7 +1904,7 @@ void write_attr_in(hid_t loc_id, } } } - + /* position integer3D of integer3D of difference ------------------------------------------------------------ @@ -1889,12 +1927,12 @@ void write_attr_in(hid_t loc_id, /*------------------------------------------------------------------------- - * Function: write_dset_in - * - * Purpose: write datasets in LOC_ID - * - *------------------------------------------------------------------------- - */ +* Function: write_dset_in +* +* Purpose: write datasets in LOC_ID +* +*------------------------------------------------------------------------- +*/ static void write_dset_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ @@ -1907,13 +1945,13 @@ void write_dset_in(hid_t loc_id, char a; double b; } s_t; - + typedef enum { RED, GREEN } e_t; - + hid_t did; hid_t sid; hid_t tid; @@ -1923,7 +1961,7 @@ void write_dset_in(hid_t loc_id, float f; int fillvalue=2; int scalar_data = 2; - + /* create 1D attributes with dimension [2], 2 elements */ hsize_t dims[1]={2}; char buf1[2][STR_SIZE]= {"ab","de"}; /* string */ @@ -1937,7 +1975,7 @@ void write_dset_in(hid_t loc_id, int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ int buf7[2]= {1,2}; /* integer */ float buf8[2]= {1,2}; /* float */ - + /* create 2D attributes with dimension [3][2], 6 elements */ hsize_t dims2[2]={3,2}; char buf12[3][2][STR_SIZE]= {{"ab","cd"},{"ef","gh"},{"ij","kl"}}; /* string */ @@ -1949,7 +1987,7 @@ void write_dset_in(hid_t loc_id, int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ - + /* create 3D attributes with dimension [4][3][2], 24 elements */ hsize_t dims3[3]={4,3,2}; char buf13[4][3][2][STR_SIZE]= {{{"ab","cd"},{"ef","gh"},{"ij","kl"}}, @@ -1964,59 +2002,59 @@ void write_dset_in(hid_t loc_id, int buf63[24][3]; /* array */ int buf73[4][3][2]; /* integer */ float buf83[4][3][2]; /* float */ - - + + /*------------------------------------------------------------------------- * H5S_SCALAR *------------------------------------------------------------------------- */ - - - + + + if ( make_diffs ) { - + scalar_data = 1; } - + /* create a space */ sid = H5Screate(H5S_SCALAR); - + /* create a dataset */ did = H5Dcreate2(loc_id, "scalar", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - + /* write */ H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &scalar_data); - + /* close */ H5Dclose(did); H5Sclose(sid); - - + + /*------------------------------------------------------------------------- * 1D *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - - + + if (make_diffs) { for (i=0; i<2; i++) for (j=0; j<2; j++) buf1[i][j]='z'; } - - + + tid = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid,(size_t)STR_SIZE); write_dset(loc_id,1,dims,"string",tid,buf1); status = H5Tclose(tid); - + for (i=0; i<2; i++) { buf1a[i]=buf1[i]; @@ -2025,27 +2063,27 @@ void write_dset_in(hid_t loc_id, status = H5Tset_size(tid, H5T_VARIABLE); write_dset(loc_id,1,dims,"VLstring",tid,buf1a); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) buf2[i]=buf2[1]=0; } - + tid = H5Tcopy(H5T_STD_B8LE); write_dset(loc_id,1,dims,"bitfield",tid,buf2); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -2053,18 +2091,18 @@ void write_dset_in(hid_t loc_id, buf3[i].a=0; buf3[i].b=0; } } - + tid = H5Tcreate(H5T_OPAQUE, (size_t)1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ write_dset(loc_id,1,dims,"opaque",tid,buf2); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- */ - - + + if (make_diffs) { for (i=0; i<2; i++) @@ -2072,13 +2110,13 @@ void write_dset_in(hid_t loc_id, buf45[i]=GREEN; } } - + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,1,dims,"compound",tid,buf3); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_REFERENCE (H5R_OBJECT object reference) *------------------------------------------------------------------------- @@ -2090,14 +2128,14 @@ void write_dset_in(hid_t loc_id, status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); } - + /*------------------------------------------------------------------------- * H5T_REFERENCE (H5R_DATASET_REGION dataset region reference) *------------------------------------------------------------------------- */ - + gen_datareg(fid,make_diffs); - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- @@ -2107,14 +2145,14 @@ void write_dset_in(hid_t loc_id, H5Tenum_insert(tid, "GREEN", (val = 1, &val)); write_dset(loc_id,1,dims,"enum",tid,buf45); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ - + buf5[0].len = 1; buf5[0].p = malloc( 1 * sizeof(int)); ((int *)buf5[0].p)[0]=1; @@ -2122,13 +2160,13 @@ void write_dset_in(hid_t loc_id, buf5[1].p = malloc( 2 * sizeof(int)); ((int *)buf5[1].p)[0]=2; ((int *)buf5[1].p)[1]=3; - + if(make_diffs) { ((int *)buf5[0].p)[0] = 0; ((int *)buf5[1].p)[0] = 0; ((int *)buf5[1].p)[1]=0; } - + sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -2139,12 +2177,12 @@ void write_dset_in(hid_t loc_id, status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); - + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -2153,7 +2191,7 @@ void write_dset_in(hid_t loc_id, buf6[i][j]=0; } } - + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 1, dims, "array", tid, buf6); status = H5Tclose(tid); @@ -2202,7 +2240,7 @@ void write_dset_in(hid_t loc_id, * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -2211,21 +2249,21 @@ void write_dset_in(hid_t loc_id, buf8[i]=0; } } - + write_dset(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); write_dset(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); - - + + /*------------------------------------------------------------------------- * 2D *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<3; i++) @@ -2233,13 +2271,13 @@ void write_dset_in(hid_t loc_id, for (k=0; k<2; k++) buf12[i][j][k]='z'; } - - + + tid = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid,(size_t)STR_SIZE); write_dset(loc_id,2,dims2,"string2D",tid,buf12); status = H5Tclose(tid); - + for (i=0; i<3; i++) { for (j=0; j<2; j++) @@ -2251,22 +2289,22 @@ void write_dset_in(hid_t loc_id, status = H5Tset_size(tid, H5T_VARIABLE); write_dset(loc_id,2,dims2,"VLstring2D",tid,buf12a); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - - + + if (make_diffs) { memset(buf22,0,sizeof buf22); } - + tid = H5Tcopy(H5T_STD_B8LE); write_dset(loc_id,2,dims2,"bitfield2D",tid,buf22); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- @@ -2275,23 +2313,23 @@ void write_dset_in(hid_t loc_id, status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ write_dset(loc_id,2,dims2,"opaque2D",tid,buf22); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf32,0,sizeof buf32); } - + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,2,dims2,"compound2D",tid,buf32); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_REFERENCE (H5R_OBJECT object reference) *------------------------------------------------------------------------- @@ -2306,23 +2344,23 @@ void write_dset_in(hid_t loc_id, } write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); } - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ - + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); write_dset(loc_id,2,dims2,"enum2D",tid,0); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n = 0; for(i = 0; i < 3; i++) @@ -2340,7 +2378,7 @@ void write_dset_in(hid_t loc_id, } } } - + sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -2351,35 +2389,35 @@ void write_dset_in(hid_t loc_id, status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); - + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf62,0,sizeof buf62); } - - + + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 2, dims2, "array2D", tid, buf62); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_INTEGER, write a fill value *------------------------------------------------------------------------- */ - - + + if (make_diffs) { memset(buf72, 0, sizeof buf72); memset(buf82, 0, sizeof buf82); } - - + + dcpl = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue); sid = H5Screate_simple(2, dims2, NULL); @@ -2388,25 +2426,25 @@ void write_dset_in(hid_t loc_id, status = H5Pclose(dcpl); status = H5Dclose(did); status = H5Sclose(sid); - + /*------------------------------------------------------------------------- * H5T_FLOAT *------------------------------------------------------------------------- */ - + write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - - + + /*------------------------------------------------------------------------- * 3D *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<4; i++) @@ -2415,12 +2453,12 @@ void write_dset_in(hid_t loc_id, for (l=0; l<2; l++) buf13[i][j][k][l]='z'; } - + tid = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid,(size_t)STR_SIZE); write_dset(loc_id,3,dims3,"string3D",tid,buf13); status = H5Tclose(tid); - + for (i=0; i<4; i++) { for (j=0; j<3; j++) @@ -2435,13 +2473,13 @@ void write_dset_in(hid_t loc_id, status = H5Tset_size(tid, H5T_VARIABLE); write_dset(loc_id,3,dims3,"VLstring3D",tid,buf13a); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - - + + n=1; for (i = 0; i < 4; i++) { @@ -2455,12 +2493,12 @@ void write_dset_in(hid_t loc_id, } } } - - + + tid = H5Tcopy(H5T_STD_B8LE); write_dset(loc_id,3,dims3,"bitfield3D",tid,buf23); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- @@ -2469,12 +2507,12 @@ void write_dset_in(hid_t loc_id, status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ write_dset(loc_id,3,dims3,"opaque3D",tid,buf23); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- */ - + n=1; for (i = 0; i < 4; i++) { @@ -2494,14 +2532,14 @@ void write_dset_in(hid_t loc_id, } } } - - + + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,3,dims3,"compound3D",tid,buf33); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_REFERENCE (H5R_OBJECT object reference) *------------------------------------------------------------------------- @@ -2517,23 +2555,23 @@ void write_dset_in(hid_t loc_id, } write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); } - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ - + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); write_dset(loc_id,3,dims3,"enum3D",tid,0); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for(i = 0; i < 4; i++) @@ -2554,7 +2592,7 @@ void write_dset_in(hid_t loc_id, } } } - + sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -2565,13 +2603,13 @@ void write_dset_in(hid_t loc_id, status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); - + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- */ - - + + n=1; for (i = 0; i < 24; i++) { for (j = 0; j < (int)dimarray[0]; j++) { @@ -2579,11 +2617,11 @@ void write_dset_in(hid_t loc_id, else buf63[i][j]=n++; } } - + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 3, dims3, "array3D", tid, buf63); status = H5Tclose(tid); - + /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- @@ -2608,14 +2646,14 @@ void write_dset_in(hid_t loc_id, } /*------------------------------------------------------------------------- - * Function: gen_datareg - * - * Purpose: generate a dataset region and its reference - * - * Date: April 19, 2006 - * - *------------------------------------------------------------------------- - */ +* Function: gen_datareg +* +* Purpose: generate a dataset region and its reference +* +* Date: April 19, 2006 +* +*------------------------------------------------------------------------- +*/ static void gen_datareg(hid_t fid, @@ -2636,44 +2674,44 @@ void gen_datareg(hid_t fid, hsize_t coord[5][2]; /* coordinates for point selection */ herr_t status; int i; - + /* allocate the buffer for write the references */ rbuf = calloc((size_t)2, sizeof(hdset_reg_ref_t)); - + /* allocate the buffer for write the data dataset */ buf = malloc(10 * 10 * sizeof(int)); - + for(i = 0; i < 10 * 10; i++) buf[i] = i; - + /* create the data dataset */ sid1 = H5Screate_simple(2, dims1, NULL); did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); assert(status >= 0); - + /* create the reference dataset */ sid2 = H5Screate_simple(1, dims2, NULL); did2 = H5Dcreate2(fid, "refreg", H5T_STD_REF_DSETREG, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - + /* create the references */ /* select hyperslab for first reference */ - + start[0] = 2; start[1] = 2; count[0] = 6; count[1] = 6; if(make_diffs) { start[0] = 0; start[1] = 0; count[0] = 3; count[1] = 3; } - + status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); assert(status >= 0); H5Sget_select_npoints(sid1); - + /* store first dataset region */ status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1); assert(status >= 0); - + /* select sequence of five points for second reference */ coord[0][0]=6; coord[0][1]=9; coord[1][0]=2; coord[1][1]=2; @@ -2688,14 +2726,14 @@ void gen_datareg(hid_t fid, } H5Sselect_elements(sid1,H5S_SELECT_SET,(size_t)5,(const hsize_t *)coord); H5Sget_select_npoints(sid1); - + /* store second dataset region */ H5Rcreate(&rbuf[1],fid,"dsetref",H5R_DATASET_REGION,sid1); - + /* write */ status = H5Dwrite(did2,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf); assert(status >= 0); - + /* close, free memory buffers */ status = H5Dclose(did1); assert(status >= 0); @@ -2712,13 +2750,13 @@ void gen_datareg(hid_t fid, /*------------------------------------------------------------------------- - * Function: test_hyperslab - * - * Purpose: test diff by hyperslabs. create a dataset with 1GB dimensions - * by iterating trough 1KB hyperslabs - * - *------------------------------------------------------------------------- - */ +* Function: test_hyperslab +* +* Purpose: test diff by hyperslabs. create a dataset with 1GB dimensions +* by iterating trough 1KB hyperslabs +* +*------------------------------------------------------------------------- +*/ static int test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers */) @@ -2739,7 +2777,7 @@ int test_hyperslab(const char *fname, char *buf=NULL; int i, j, s; char c; - + /* create */ fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -2758,7 +2796,7 @@ int test_hyperslab(const char *fname, goto out; if((size = H5Tget_size(tid)) <= 0) goto out; - + /* create a evenly divided buffer from 0 to 127 */ buf = (char *)HDmalloc((size_t)(nelmts * size)); s = 1024 * 1024 / 127; @@ -2767,29 +2805,29 @@ int test_hyperslab(const char *fname, c++; j = 0; } - + /* set the hyperslab values */ HDmemset(buf, c, nelmts); - + /* make a different hyperslab at this position */ if(make_diffs && i == 512 * 512) HDmemset(buf, 0, nelmts); - + hs_start[0] = i * GBLL/(1024*1024); if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0) goto out; - + /* write only one hyperslab */ if ( i==512*512) { if (H5Dwrite (did,H5T_NATIVE_CHAR,m_sid,f_sid,H5P_DEFAULT,buf) < 0) goto out; } - + } free(buf); buf=NULL; - + /* close */ if(H5Sclose(f_sid) < 0) goto out; @@ -2800,9 +2838,9 @@ int test_hyperslab(const char *fname, if(H5Dclose(did) < 0) goto out; H5Fclose(fid); - + return 0; - + out: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -2812,17 +2850,17 @@ out: H5Fclose(fid); } H5E_END_TRY; return -1; - + } /*------------------------------------------------------------------------- - * Function: write_attr - * - * Purpose: utility function to write an attribute in LOC_ID - * - *------------------------------------------------------------------------- - */ +* Function: write_attr +* +* Purpose: utility function to write an attribute in LOC_ID +* +*------------------------------------------------------------------------- +*/ static int write_attr(hid_t loc_id, int rank, @@ -2863,19 +2901,19 @@ out: } /*------------------------------------------------------------------------- - * Function: write_dset - * - * Purpose: utility function to create and write a dataset in LOC_ID - * - *------------------------------------------------------------------------- - */ +* Function: write_dset +* +* Purpose: utility function to create and write a dataset in LOC_ID +* +*------------------------------------------------------------------------- +*/ static int write_dset( hid_t loc_id, - int rank, - hsize_t *dims, - const char *name, - hid_t tid, - void *buf ) + int rank, + hsize_t *dims, + const char *name, + hid_t tid, + void *buf ) { hid_t did=-1; hid_t sid=-1; diff --git a/tools/h5diff/testfiles/h5diff_201.txt b/tools/h5diff/testfiles/h5diff_201.txt index 599cc2b..a212444 100644 --- a/tools/h5diff/testfiles/h5diff_201.txt +++ b/tools/h5diff/testfiles/h5diff_201.txt @@ -1 +1 @@ - or are empty datasets +Not comparable: or are empty datasets diff --git a/tools/h5diff/testfiles/h5diff_202.txt b/tools/h5diff/testfiles/h5diff_202.txt index a881cf5..ee240c2 100644 --- a/tools/h5diff/testfiles/h5diff_202.txt +++ b/tools/h5diff/testfiles/h5diff_202.txt @@ -1,2 +1,2 @@ is of class H5T_FLOAT and is of class H5T_INTEGER - has sign H5T_SGN_ERROR and has sign H5T_SGN_2 +Not comparable: has sign H5T_SGN_ERROR and has sign H5T_SGN_2 diff --git a/tools/h5diff/testfiles/h5diff_203.txt b/tools/h5diff/testfiles/h5diff_203.txt index aea1891..49ee21c 100644 --- a/tools/h5diff/testfiles/h5diff_203.txt +++ b/tools/h5diff/testfiles/h5diff_203.txt @@ -1,2 +1,2 @@ - has rank 1, dimensions [6], max dimensions [6] +Not comparable: has rank 1, dimensions [6], max dimensions [6] has rank 2, dimensions [3x2], max dimensions [3x2] diff --git a/tools/h5diff/testfiles/h5diff_204.txt b/tools/h5diff/testfiles/h5diff_204.txt index 66b9e63..5a3d87f 100644 --- a/tools/h5diff/testfiles/h5diff_204.txt +++ b/tools/h5diff/testfiles/h5diff_204.txt @@ -1,2 +1,2 @@ - has rank 2, dimensions [3x2], max dimensions [3x2] +Not comparable: has rank 2, dimensions [3x2], max dimensions [3x2] has rank 2, dimensions [2x2], max dimensions [2x2] diff --git a/tools/h5diff/testfiles/h5diff_205.txt b/tools/h5diff/testfiles/h5diff_205.txt index f7360ab..81298af 100644 --- a/tools/h5diff/testfiles/h5diff_205.txt +++ b/tools/h5diff/testfiles/h5diff_205.txt @@ -1,3 +1,3 @@ - has rank 2, dimensions [2x2], max dimensions [2x2] +Not comparable: has rank 2, dimensions [2x2], max dimensions [2x2] has rank 2, dimensions [3x2], max dimensions [3x2] - has sign H5T_SGN_2 and has sign H5T_SGN_NONE +Not comparable: has sign H5T_SGN_2 and has sign H5T_SGN_NONE diff --git a/tools/h5diff/testfiles/h5diff_206.txt b/tools/h5diff/testfiles/h5diff_206.txt index 8bbbb9a..164aed9 100644 --- a/tools/h5diff/testfiles/h5diff_206.txt +++ b/tools/h5diff/testfiles/h5diff_206.txt @@ -1 +1 @@ - has a class H5T_FLOAT and has a class H5T_INTEGER +Not comparable: has a class H5T_FLOAT and has a class H5T_INTEGER diff --git a/tools/h5diff/testfiles/h5diff_207.txt b/tools/h5diff/testfiles/h5diff_207.txt index 833afe8..f8152f8 100644 --- a/tools/h5diff/testfiles/h5diff_207.txt +++ b/tools/h5diff/testfiles/h5diff_207.txt @@ -1,2 +1,2 @@ - or are empty datasets - has 2 members has 1 members +Not comparable: or are empty datasets +Not comparable: has 2 members has 1 members diff --git a/tools/h5diff/testfiles/h5diff_57.txt b/tools/h5diff/testfiles/h5diff_57.txt index c1a0d64..a026077 100644 --- a/tools/h5diff/testfiles/h5diff_57.txt +++ b/tools/h5diff/testfiles/h5diff_57.txt @@ -2,7 +2,7 @@ dataset: and Warning: different storage datatype has file datatype H5T_STD_I8LE has file datatype H5T_STD_U8LE - has sign H5T_SGN_2 and has sign H5T_SGN_NONE +Not comparable: has sign H5T_SGN_2 and has sign H5T_SGN_NONE 0 differences found -------------------------------- Some objects are not comparable diff --git a/tools/h5diff/testfiles/h5diff_70.txt b/tools/h5diff/testfiles/h5diff_70.txt index 42fe6fc..b42cacd 100644 --- a/tools/h5diff/testfiles/h5diff_70.txt +++ b/tools/h5diff/testfiles/h5diff_70.txt @@ -677,7 +677,7 @@ position float3D of float3D of difference [ 3 2 1 ] 24 0 24 24 differences found dataset: and - or are empty datasets +Not comparable: or are empty datasets attribute: > and > size: [2] [2] position string of string of difference diff --git a/tools/h5diff/testfiles/h5diff_80.txt b/tools/h5diff/testfiles/h5diff_80.txt index a52b24e..c8ec309 100644 --- a/tools/h5diff/testfiles/h5diff_80.txt +++ b/tools/h5diff/testfiles/h5diff_80.txt @@ -245,7 +245,7 @@ position array3D array3D difference [ 3 2 1 ] 72 0 72 72 differences found dataset: and - or are empty datasets +Not comparable: or are empty datasets 0 differences found dataset: and size: [2] [2] @@ -380,10 +380,10 @@ position enum enum difference [ 0 ] RED GREEN 1 differences found dataset: and - or are empty datasets +Not comparable: or are empty datasets 0 differences found dataset: and - or are empty datasets +Not comparable: or are empty datasets 0 differences found dataset: and size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_90.txt b/tools/h5diff/testfiles/h5diff_90.txt index 71b960e..a513ffa 100644 --- a/tools/h5diff/testfiles/h5diff_90.txt +++ b/tools/h5diff/testfiles/h5diff_90.txt @@ -30,7 +30,7 @@ dataset: and group : and 0 differences found dataset: and - or are empty datasets +Not comparable: or are empty datasets 0 differences found dataset: and 0 differences found @@ -47,7 +47,7 @@ dataset: and dataset: and 0 differences found dataset: and - or are empty datasets +Not comparable: or are empty datasets 0 differences found -------------------------------- Some objects are not comparable diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 9bf42b7..0d77850 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -385,8 +385,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -501,7 +501,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 600de9b..5d3db21 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -104,8 +104,8 @@ static H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | d **/ /* module-scoped variables for XML option */ -#define DEFAULT_XSD "http://hdfgroup.org/DTDs/HDF5-File.xsd" -#define DEFAULT_DTD "http://hdfgroup.org/DTDs/HDF5-File.dtd" +#define DEFAULT_XSD "http://www.hdfgroup.org/DTDs/HDF5-File.xsd" +#define DEFAULT_DTD "http://www.hdfgroup.org/DTDs/HDF5-File.dtd" static int doxml = 0; static int useschema = 1; @@ -4389,8 +4389,8 @@ main(int argc, const char *argv[]) printf("<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/DTDs/HDF5-File\" " "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " - "xsi:schemaLocation=\"http://hdfgroup.org/DTDs/HDF5File " - "http://hdfgroup.org/DTDs/HDF5-File.xsd\">\n",xmlnsprefix,ns); + "xsi:schemaLocation=\"http://hdfgroup.org/DTDs/HDF5-File " + "http://www.hdfgroup.org/DTDs/HDF5-File.xsd\">\n",xmlnsprefix,ns); } } else { printf("\n", diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index b8a3753..c7e1445 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -122,7 +122,7 @@ set_local_myfilter(hid_t dcpl_id, hid_t tid, hid_t UNUSED sid); #define MYFILTER_ID 405 /* This message derives from H5Z */ -const H5Z_class_t H5Z_MYFILTER[1] = {{ +const H5Z_class2_t H5Z_MYFILTER[1] = {{ H5Z_CLASS_T_VERS, MYFILTER_ID, /* Filter id number */ 1, 1, diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 65cefc8..9314d90 100755 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -376,8 +376,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -484,7 +484,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 32a6c2f..87d1c6b 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -388,8 +388,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -510,7 +510,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index bfc0e78..72fc0bf 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -369,8 +369,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -468,7 +468,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 1a5990d..7320ce0 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -403,8 +403,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -531,7 +531,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 92db049..d8a503c 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -27,10 +27,10 @@ extern char *progname; /*------------------------------------------------------------------------- - * File: h5repack.c - * Purpose: Public API functions - *------------------------------------------------------------------------- - */ +* File: h5repack.c +* Purpose: Public API functions +*------------------------------------------------------------------------- +*/ static int check_options(pack_opt_t *options); static int check_objects(const char* fname, pack_opt_t *options); @@ -40,24 +40,24 @@ static int have_request(pack_opt_t *options); /*------------------------------------------------------------------------- - * Function: h5repack - * - * Purpose: locate all high-level HDF5 objects in the file - * and compress/chunk them using options - * - * Algorithm: 2 traversals are made to the file; the 1st builds a list of - * the objects, the 2nd makes a copy of them, using the options; - * the reason for the 1st traversal is to check for invalid - * object name requests - * - * Return: 0, ok, -1, fail - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: September, 22, 2003 - * - *------------------------------------------------------------------------- - */ +* Function: h5repack +* +* Purpose: locate all high-level HDF5 objects in the file +* and compress/chunk them using options +* +* Algorithm: 2 traversals are made to the file; the 1st builds a list of +* the objects, the 2nd makes a copy of them, using the options; +* the reason for the 1st traversal is to check for invalid +* object name requests +* +* Return: 0, ok, -1, fail +* +* Programmer: pvn@ncsa.uiuc.edu +* +* Date: September, 22, 2003 +* +*------------------------------------------------------------------------- +*/ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) @@ -81,14 +81,14 @@ int h5repack(const char* infile, /*------------------------------------------------------------------------- - * Function: h5repack_init - * - * Purpose: initialize options - * - * Return: 0, ok, -1, fail - * - *------------------------------------------------------------------------- - */ +* Function: h5repack_init +* +* Purpose: initialize options +* +* Return: 0, ok, -1, fail +* +*------------------------------------------------------------------------- +*/ int h5repack_init (pack_opt_t *options, int verbose) @@ -110,12 +110,12 @@ int h5repack_init (pack_opt_t *options, } /*------------------------------------------------------------------------- - * Function: h5repack_end - * - * Purpose: free options table - * - *------------------------------------------------------------------------- - */ +* Function: h5repack_end +* +* Purpose: free options table +* +*------------------------------------------------------------------------- +*/ int h5repack_end (pack_opt_t *options) { @@ -123,15 +123,15 @@ int h5repack_end (pack_opt_t *options) } /*------------------------------------------------------------------------- - * Function: h5repack_addfilter - * - * Purpose: add a compression -f option to table - * Example: -f dset:GZIP=6 - * - * Return: 0, ok, -1, fail - * - *------------------------------------------------------------------------- - */ +* Function: h5repack_addfilter +* +* Purpose: add a compression -f option to table +* Example: -f dset:GZIP=6 +* +* Return: 0, ok, -1, fail +* +*------------------------------------------------------------------------- +*/ int h5repack_addfilter(const char* str, pack_opt_t *options) @@ -177,14 +177,14 @@ int h5repack_addfilter(const char* str, /*------------------------------------------------------------------------- - * Function: h5repack_addlayout - * - * Purpose: add a layout option - * - * Return: 0, ok, -1, fail - * - *------------------------------------------------------------------------- - */ +* Function: h5repack_addlayout +* +* Purpose: add a layout option +* +* Return: 0, ok, -1, fail +* +*------------------------------------------------------------------------- +*/ int h5repack_addlayout(const char* str, @@ -199,9 +199,9 @@ int h5repack_addlayout(const char* str, init_packobject(&pack); if (options->all_layout==1){ - error_msg(progname, "invalid layout input: 'all' option \ - is present with other objects <%s>\n",str); - return -1; + error_msg(progname, "invalid layout input: 'all' option \ + is present with other objects <%s>\n",str); + return -1; } /* parse the layout option */ @@ -215,7 +215,7 @@ int h5repack_addlayout(const char* str, options->layout_g=pack.layout; if (pack.layout==H5D_CHUNKED) { - /* -2 means the NONE option, remove chunking + /* -2 means the NONE option, remove chunking and set the global layout to contiguous */ if (pack.chunk.rank==-2) { @@ -243,22 +243,22 @@ int h5repack_addlayout(const char* str, /*------------------------------------------------------------------------- - * Function: check_options - * - * Purpose: print options, checks for invalid options - * - * Return: void, return -1 on error - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: September, 22, 2003 - * - * Modification: - * Peter Cao, July 9, 2007 - * Add "-L, --latest" and other options to pack a file with the latest file format - * - *------------------------------------------------------------------------- - */ +* Function: check_options +* +* Purpose: print options, checks for invalid options +* +* Return: void, return -1 on error +* +* Programmer: pvn@ncsa.uiuc.edu +* +* Date: September, 22, 2003 +* +* Modification: +* Peter Cao, July 9, 2007 +* Add "-L, --latest" and other options to pack a file with the latest file format +* +*------------------------------------------------------------------------- +*/ static int check_options(pack_opt_t *options) { unsigned int i; @@ -272,7 +272,8 @@ static int check_options(pack_opt_t *options) if (options->verbose && have_request(options) /* only print if requested */) { printf("Objects to modify layout are...\n"); - if (options->all_layout==1) { + if (options->all_layout==1) + { switch (options->layout_g) { case H5D_COMPACT: @@ -284,12 +285,17 @@ static int check_options(pack_opt_t *options) case H5D_CHUNKED: strcpy(slayout,"chunked"); break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: + error_msg(progname, "invalid layout\n"); + return -1; default: - strcpy(slayout,"unknown"); - break; + strcpy(slayout,"invalid layout\n"); + return -1; } printf(" Apply %s layout to all\n", slayout); - if (H5D_CHUNKED==options->layout_g) { + if (H5D_CHUNKED==options->layout_g) + { printf("with dimension ["); for ( j = 0; j < options->chunk_g.rank; j++) printf("%d ",(int)options->chunk_g.chunk_lengths[j]); @@ -322,9 +328,9 @@ static int check_options(pack_opt_t *options) if (options->all_layout==1 && has_ck) { - error_msg(progname, "invalid chunking input: 'all' option\ - is present with other objects\n"); - return -1; + error_msg(progname, "invalid chunking input: 'all' option\ + is present with other objects\n"); + return -1; } /*------------------------------------------------------------------------- @@ -356,6 +362,8 @@ static int check_options(pack_opt_t *options) get_sfilter(filtn), options->filter_g[k].cd_values[0]); break; + default: + break; } /* k */ }; } @@ -382,9 +390,9 @@ static int check_options(pack_opt_t *options) if (options->all_filter==1 && has_cp) { - error_msg(progname, "invalid compression input: 'all' option\ - is present with other objects\n"); - return -1; + error_msg(progname, "invalid compression input: 'all' option\ + is present with other objects\n"); + return -1; } /*------------------------------------------------------------------------- @@ -455,19 +463,19 @@ static int check_options(pack_opt_t *options) /*------------------------------------------------------------------------- - * Function: check_objects - * - * Purpose: locate all HDF5 objects in the file and compare with user - * supplied list - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September, 23, 2003 - * - *------------------------------------------------------------------------- - */ +* Function: check_objects +* +* Purpose: locate all HDF5 objects in the file and compare with user +* supplied list +* +* Return: 0, ok, -1 no +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: September, 23, 2003 +* +*------------------------------------------------------------------------- +*/ static int check_objects(const char* fname, pack_opt_t *options) { @@ -480,9 +488,9 @@ static int check_objects(const char* fname, return 0; /*------------------------------------------------------------------------- - * open the file - *------------------------------------------------------------------------- - */ + * open the file + *------------------------------------------------------------------------- + */ if((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0) { printf("<%s>: %s\n", fname, H5FOPENERROR ); @@ -490,9 +498,9 @@ static int check_objects(const char* fname, } /*------------------------------------------------------------------------- - * get the list of objects in the file - *------------------------------------------------------------------------- - */ + * get the list of objects in the file + *------------------------------------------------------------------------- + */ /* init table */ trav_table_init(&travt); @@ -502,9 +510,9 @@ static int check_objects(const char* fname, goto out; /*------------------------------------------------------------------------- - * compare with user supplied list - *------------------------------------------------------------------------- - */ + * compare with user supplied list + *------------------------------------------------------------------------- + */ if(options->verbose) printf("Opening file <%s>. Searching for objects to modify...\n", fname); @@ -529,7 +537,7 @@ static int check_objects(const char* fname, switch(options->op_tbl->objs[i].filter->filtn) { /* chunk size must be smaller than pixels per block */ - case H5Z_FILTER_SZIP: + case H5Z_FILTER_SZIP: { int j; hsize_t csize = 1; @@ -568,10 +576,12 @@ static int check_objects(const char* fname, } } break; + default: + break; } } /* i */ - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ @@ -590,16 +600,16 @@ out: /*------------------------------------------------------------------------- - * Function: have_request - * - * Purpose: check if a filter or layout was requested - * - * Return: 1 yes, 0 no - * - * Date: May, 24, 2007 - * - *------------------------------------------------------------------------- - */ +* Function: have_request +* +* Purpose: check if a filter or layout was requested +* +* Return: 1 yes, 0 no +* +* Date: May, 24, 2007 +* +*------------------------------------------------------------------------- +*/ static int have_request(pack_opt_t *options) { @@ -612,14 +622,14 @@ static int have_request(pack_opt_t *options) /*------------------------------------------------------------------------- - * Function: get_sfilter - * - * Purpose: return the filter as a string name - * - * Return: name of filter, exit on error - * - *------------------------------------------------------------------------- - */ +* Function: get_sfilter +* +* Purpose: return the filter as a string name +* +* Return: name of filter, exit on error +* +*------------------------------------------------------------------------- +*/ static const char* get_sfilter(H5Z_filter_t filtn) { @@ -641,6 +651,5 @@ static const char* get_sfilter(H5Z_filter_t filtn) error_msg(progname, "input error in filter type\n"); exit(1); } - return NULL; } diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index b63102b..cb3d75a 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -131,7 +131,7 @@ int h5repack_addlayout (const char* str, pack_opt_t *options); int h5repack_init (pack_opt_t *options, int verbose); int h5repack_end (pack_opt_t *options); int h5repack_verify (const char *fname,pack_opt_t *options); -int h5repack_cmpdcpl (const char *fname1, +int h5repack_cmp_pl (const char *fname1, const char *fname2); diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 4a48c8a..a09e8b9 100755 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -53,6 +53,7 @@ FILE12=h5repack_nbit.h5 FILE13=h5repack_soffset.h5 FILE14=h5repack_layouto.h5 # A file with an older version of the layout message # (copy of test/tlayouto.h5) +FILE15=h5repack_named_dtypes.h5 nerrors=0 @@ -455,7 +456,10 @@ TOOLTEST $FILE4 -l dset_chunk:CONTI TOOLTEST $FILE4 -l dset_chunk:CHUNK=18x13 # Native option -TOOLTEST $FILE1 -n +# Do not use FILE1, as the named dtype will be converted to native, and h5diff will +# report a difference. +TOOLTEST $FILE0 -n +TOOLTEST $FILE2 -n # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) @@ -507,6 +511,9 @@ TOOLTEST $FILE14 # test for datum size > H5TOOLS_MALLOCSIZE TOOLTEST $FILE1 -f GZIP=1 +# Check repacking file with committed datatypes in odd configurations +TOOLTEST $FILE15 + if test $nerrors -eq 0 ; then echo "All $H5REPACK tests passed." fi diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 4e2e036..73f57e3 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -21,50 +21,67 @@ #include "h5tools.h" #include "h5tools_utils.h" -extern char *progname; +/*------------------------------------------------------------------------- +* typedefs +*------------------------------------------------------------------------- +*/ +typedef struct named_dt_t { + haddr_t addr_in; /* Address of the named dtype in the in file */ + hid_t id_out; /* Open identifier for the dtype in the out file */ + struct named_dt_t *next; /* Next dtype */ +} named_dt_t; +/*------------------------------------------------------------------------- +* globals +*------------------------------------------------------------------------- +*/ +extern char *progname; /*------------------------------------------------------------------------- - * macros - *------------------------------------------------------------------------- - */ +* macros +*------------------------------------------------------------------------- +*/ #define USERBLOCK_XFER_SIZE 512 /* size of buffer/# of bytes to xfer at a time when copying userblock */ /*------------------------------------------------------------------------- - * local functions - *------------------------------------------------------------------------- - */ +* local functions +*------------------------------------------------------------------------- +*/ 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); -static int copy_attr(hid_t loc_in,hid_t loc_out,pack_opt_t *options); +static int copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, + trav_table_t *travt, pack_opt_t *options); +static hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, + trav_table_t *travt, pack_opt_t *options); +static int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err); static int copy_user_block(const char *infile, const char *outfile, hsize_t size); #if defined (H5REPACK_DEBUG_USER_BLOCK) static void print_user_block(const char *filename, hid_t fid); #endif /*------------------------------------------------------------------------- - * Function: copy_objects - * - * Purpose: duplicate all HDF5 objects in the file - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * 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 - * - *------------------------------------------------------------------------- - */ +* Function: copy_objects +* +* Purpose: duplicate all HDF5 objects in the file +* +* Return: 0, ok, -1 no +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* 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, @@ -90,19 +107,19 @@ int copy_objects(const char* fnamein, /* get user block size */ { hid_t fcpl_in; /* file creation property list ID for input file */ - + if((fcpl_in = H5Fget_create_plist(fidin)) < 0) { error_msg(progname, "failed to retrieve file creation property list\n"); goto out; } - + if(H5Pget_userblock(fcpl_in, &ub_size) < 0) { error_msg(progname, "failed to retrieve userblock size\n"); goto out; } - + if(H5Pclose(fcpl_in) < 0) { error_msg(progname, "failed to close property list\n"); @@ -147,25 +164,27 @@ int copy_objects(const char* fnamein, { switch(i) { - case 0: - mesg_type_flags[nindex] = H5O_SHMESG_SDSPACE_FLAG; - break; - - case 1: - mesg_type_flags[nindex] = H5O_SHMESG_DTYPE_FLAG; - break; - - case 2: - mesg_type_flags[nindex] = H5O_SHMESG_FILL_FLAG; - break; - - case 3: - mesg_type_flags[nindex] = H5O_SHMESG_PLINE_FLAG; - break; - - case 4: - mesg_type_flags[nindex] = H5O_SHMESG_ATTR_FLAG; - break; + case 0: + mesg_type_flags[nindex] = H5O_SHMESG_SDSPACE_FLAG; + break; + + case 1: + mesg_type_flags[nindex] = H5O_SHMESG_DTYPE_FLAG; + break; + + case 2: + mesg_type_flags[nindex] = H5O_SHMESG_FILL_FLAG; + break; + + case 3: + mesg_type_flags[nindex] = H5O_SHMESG_PLINE_FLAG; + break; + + case 4: + mesg_type_flags[nindex] = H5O_SHMESG_ATTR_FLAG; + break; + default: + break; } /* end switch */ min_mesg_sizes[nindex] = (unsigned)options->msg_size[i]; @@ -205,8 +224,8 @@ int copy_objects(const char* fnamein, } /* end if */ } /* end if */ } /* end if */ - - + + #if defined (H5REPACK_DEBUG_USER_BLOCK) @@ -230,30 +249,30 @@ int copy_objects(const char* fnamein, error_msg(progname, "failed to set userblock size\n"); goto out; } - + } - + else { - + /* create a file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { error_msg(progname, "fail to create a file creation property list\n"); goto out; } - + /* set user block size */ if(H5Pset_userblock(fcpl, options->ublock_size) < 0) { error_msg(progname, "failed to set userblock size\n"); goto out; } - + } - - - + + + } @@ -262,39 +281,39 @@ int copy_objects(const char* fnamein, *------------------------------------------------------------------------- */ - + if ( options->alignment > 0 ) { /* either use the FAPL already created or create a new one */ if (fapl != H5P_DEFAULT) { - + if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { error_msg(progname, "failed to set alignment\n"); goto out; } - + } - + else { - + /* create a file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { error_msg(progname, "Could not create file access property list\n"); goto out; } - + if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { error_msg(progname, "failed to set alignment\n"); goto out; } - + } - + } @@ -303,18 +322,18 @@ int copy_objects(const char* fnamein, *------------------------------------------------------------------------- */ - + if(options->verbose) printf("Making file <%s>...\n",fnameout); - - + + if((fidout = H5Fcreate(fnameout,H5F_ACC_TRUNC, fcpl, fapl)) < 0) { error_msg(progname, "<%s>: Could not create file\n", fnameout ); goto out; } - + /*------------------------------------------------------------------------- * write a new user block if requested *------------------------------------------------------------------------- @@ -325,11 +344,11 @@ int copy_objects(const char* fnamein, { error_msg(progname, "Could not copy user block. Exiting...\n"); goto out; - + } } - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * get list of objects *------------------------------------------------------------------------- */ @@ -375,7 +394,7 @@ int copy_objects(const char* fnamein, H5Fclose(fidin); H5Fclose(fidout); - + /* free table */ trav_table_free(travt); travt = NULL; @@ -391,7 +410,7 @@ int copy_objects(const char* fnamein, { error_msg(progname, "Could not copy user block. Exiting...\n"); goto out; - + } } @@ -417,74 +436,74 @@ out: } /*------------------------------------------------------------------------- - * Function: do_copy_objects - * - * Purpose: duplicate all HDF5 objects in the file - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October, 23, 2003 - * - * Modifications: - * - * July 2004: Introduced the extra EC or NN option for SZIP - * - * December 2004: Added a check for H5Dcreate; if the dataset cannot be created - * with the requested filter, use the input one - * - * October 2006: Read/write using the file type by default. - * - * October 2006: Read by hyperslabs for big datasets. - * - * A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done - * i.e., if the memory needed to read a dataset is greater than this limit, - * then hyperslab I/O is done instead of one operation I/O - * For each dataset, the memory needed is calculated according to - * - * memory needed = number of elements * size of each element - * - * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations - * are done - * - * H5Dread( input_dataset1 ) - * H5Dread( input_dataset2 ) - * - * with all elements in the datasets selected. If the memory needed is greater than - * H5TOOLS_MALLOCSIZE, then the following operations are done instead: - * - * a strip mine is defined for each dimension k (a strip mine is defined as a - * hyperslab whose size is memory manageable) according to the formula - * - * (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type) - * - * where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures - * that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip - * mine size k is simply defined as its dimension k, but for larger datasets the - * hyperslab size is still memory manageable. - * a cycle is done until the number of elements in the dataset is reached. In each - * iteration, two parameters are defined for the function H5Sselect_hyperslab, - * the start and size of each hyperslab, according to - * - * (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k]) - * - * where hyperslab_offset [k] is initially set to zero, and later incremented in - * hyperslab_size[k] offsets. The reason for the operation - * - * dimension[k] - hyperslab_offset[k] - * - * in (2) is that, when using the strip mine size, it assures that the "remaining" part - * of the dataset that does not fill an entire strip mine is processed. - * - * November 2006: Use H5Ocopy in the copy of objects. The logic for using - * H5Ocopy or not is if a change of filters or layout is requested by the user - * then use read/write else use H5Ocopy. - * - * May, 1, 2008: Add a printing of the compression ratio of old size / new size - * - *------------------------------------------------------------------------- - */ +* Function: do_copy_objects +* +* Purpose: duplicate all HDF5 objects in the file +* +* Return: 0, ok, -1 no +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: October, 23, 2003 +* +* Modifications: +* +* July 2004: Introduced the extra EC or NN option for SZIP +* +* December 2004: Added a check for H5Dcreate; if the dataset cannot be created +* with the requested filter, use the input one +* +* October 2006: Read/write using the file type by default. +* +* October 2006: Read by hyperslabs for big datasets. +* +* A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done +* i.e., if the memory needed to read a dataset is greater than this limit, +* then hyperslab I/O is done instead of one operation I/O +* For each dataset, the memory needed is calculated according to +* +* memory needed = number of elements * size of each element +* +* if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations +* are done +* +* H5Dread( input_dataset1 ) +* H5Dread( input_dataset2 ) +* +* with all elements in the datasets selected. If the memory needed is greater than +* H5TOOLS_MALLOCSIZE, then the following operations are done instead: +* +* a strip mine is defined for each dimension k (a strip mine is defined as a +* hyperslab whose size is memory manageable) according to the formula +* +* (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type) +* +* where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures +* that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip +* mine size k is simply defined as its dimension k, but for larger datasets the +* hyperslab size is still memory manageable. +* a cycle is done until the number of elements in the dataset is reached. In each +* iteration, two parameters are defined for the function H5Sselect_hyperslab, +* the start and size of each hyperslab, according to +* +* (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k]) +* +* where hyperslab_offset [k] is initially set to zero, and later incremented in +* hyperslab_size[k] offsets. The reason for the operation +* +* dimension[k] - hyperslab_offset[k] +* +* in (2) is that, when using the strip mine size, it assures that the "remaining" part +* of the dataset that does not fill an entire strip mine is processed. +* +* November 2006: Use H5Ocopy in the copy of objects. The logic for using +* H5Ocopy or not is if a change of filters or layout is requested by the user +* then use read/write else use H5Ocopy. +* +* May, 1, 2008: Add a printing of the compression ratio of old size / new size +* +*------------------------------------------------------------------------- +*/ int do_copy_objects(hid_t fidin, hid_t fidout, @@ -495,7 +514,8 @@ int do_copy_objects(hid_t fidin, hid_t grp_out=-1; /* group ID */ hid_t dset_in=-1; /* read dataset ID */ hid_t dset_out=-1; /* write dataset ID */ - hid_t gcpl_id=-1; /* group creation property list */ + hid_t gcpl_in=-1; /* group creation property list */ + hid_t gcpl_out=-1; /* group creation property list */ hid_t type_in=-1; /* named type ID */ hid_t type_out=-1; /* named type ID */ hid_t dcpl_id=-1; /* dataset creation property list ID */ @@ -503,6 +523,7 @@ int do_copy_objects(hid_t fidin, hid_t f_space_id=-1; /* file space ID */ hid_t ftype_id=-1; /* file type ID */ hid_t wtype_id=-1; /* read/write type ID */ + named_dt_t *named_dt_head=NULL; /* Pointer to the stack of named datatypes copied */ size_t msize; /* size of type */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ @@ -515,9 +536,11 @@ int do_copy_objects(hid_t fidin, void *sm_buf=NULL; /* buffer for raw data */ int has_filter; /* current object has a filter */ int req_filter; /* there was a request for a filter */ + unsigned crt_order_flags; /* group creation order flag */ unsigned i; unsigned u; int is_ref=0; + htri_t is_named; /*------------------------------------------------------------------------- * copy the suppplied object list @@ -537,510 +560,548 @@ int do_copy_objects(hid_t fidin, buf = NULL; switch ( travt->objs[i].type ) { + + case H5TRAV_TYPE_UNKNOWN: + assert(0); + break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_GROUP - *------------------------------------------------------------------------- - */ - case H5TRAV_TYPE_GROUP: - if (options->verbose) - printf(FORMAT_OBJ,"group",travt->objs[i].name ); + * H5TRAV_TYPE_GROUP + *------------------------------------------------------------------------- + */ + case H5TRAV_TYPE_GROUP: - /*------------------------------------------------------------------------- - * the root is a special case, we get an ID for the root group - * and copy its attributes using that ID - *------------------------------------------------------------------------- - */ - if(HDstrcmp(travt->objs[i].name, "/") == 0) - { - if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0) - goto error; - } - else if (options->grp_compact>0 || options->grp_indexed>0) - { - /* Set up group creation property list */ - if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - goto error; + if (options->verbose) + { + printf(FORMAT_OBJ,"group",travt->objs[i].name ); + } - if(H5Pset_link_phase_change(gcpl_id, (unsigned)options->grp_compact, (unsigned)options->grp_indexed) < 0) - goto error; + /* open input group */ + if ((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) + goto error; - if((grp_out = H5Gcreate2(fidout, travt->objs[i].name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) - goto error; - } - else - { - if((grp_out = H5Gcreate2(fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; - } + /* get input group creation property list */ + if ((gcpl_in = H5Gget_create_plist(grp_in)) < 0) + goto error; - if((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) - goto error; + /* query and set the group creation properties */ + if (H5Pget_link_creation_order(gcpl_in, &crt_order_flags) < 0) + goto error; - /*------------------------------------------------------------------------- - * copy attrs - *------------------------------------------------------------------------- - */ - if(copy_attr(grp_in,grp_out,options) < 0) + /* set up group creation property list */ + if ((gcpl_out = H5Pcreate(H5P_GROUP_CREATE)) < 0) + goto error; + + if (H5Pset_link_creation_order(gcpl_out, crt_order_flags) < 0) + goto error; + + + /*------------------------------------------------------------------------- + * the root is a special case, we get an ID for the root group + * and copy its attributes using that ID + *------------------------------------------------------------------------- + */ + if(HDstrcmp(travt->objs[i].name, "/") == 0) + { + if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0) goto error; + } + + else + { - if(gcpl_id > 0) { - if(H5Pclose(gcpl_id) < 0) + if (options->grp_compact>0 || options->grp_indexed>0) + { + if(H5Pset_link_phase_change(gcpl_out, (unsigned)options->grp_compact, (unsigned)options->grp_indexed) < 0) goto error; } - if(H5Gclose(grp_out) < 0) - goto error; - if(H5Gclose(grp_in) < 0) + + if((grp_out = H5Gcreate2(fidout, travt->objs[i].name, H5P_DEFAULT, gcpl_out, H5P_DEFAULT)) < 0) goto error; - break; + } + + /*------------------------------------------------------------------------- + * copy attrs + *------------------------------------------------------------------------- + */ + if(copy_attr(grp_in, grp_out, &named_dt_head, travt, options) < 0) + goto error; + + + if(H5Pclose(gcpl_out) < 0) + goto error; + if(H5Pclose(gcpl_in) < 0) + goto error; + if(H5Gclose(grp_out) < 0) + goto error; + if(H5Gclose(grp_in) < 0) + goto error; + + break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_DATASET - *------------------------------------------------------------------------- - */ - case H5TRAV_TYPE_DATASET: + * H5TRAV_TYPE_DATASET + *------------------------------------------------------------------------- + */ + case H5TRAV_TYPE_DATASET: + + has_filter = 0; + req_filter = 0; - has_filter = 0; - req_filter = 0; + /* check if global filters were requested */ + if ( options->n_filter_g ) + req_filter = 1; - /* check if global filters were requested */ - if ( options->n_filter_g ) - req_filter = 1; + /* check if filters were requested for individual objects */ + for( u = 0; u < options->op_tbl->nelems; u++) + { + int k; - /* check if filters were requested for individual objects */ - for( u = 0; u < options->op_tbl->nelems; u++) + for( k = 0; k < options->op_tbl->objs[u].nfilters; k++) { - int k; - - for( k = 0; k < options->op_tbl->objs[u].nfilters; k++) + if ( options->op_tbl->objs[u].filter->filtn > 0 ) { - if ( options->op_tbl->objs[u].filter->filtn > 0 ) - { - - req_filter = 1; - - } - + + req_filter = 1; + } + } + } + + /* early detection of references */ + if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) + goto error; + if((ftype_id = H5Dget_type(dset_in)) < 0) + goto error; + if(H5T_REFERENCE == H5Tget_class(ftype_id)) + is_ref = 1; + + /* Check if the datatype is committed */ + if((is_named = H5Tcommitted(ftype_id)) < 0) + goto error; + if(is_named) + if((wtype_id = copy_named_datatype(ftype_id, fidout, &named_dt_head, travt, options)) < 0) + goto error; + + if(H5Tclose(ftype_id) < 0) + goto error; + if(H5Dclose(dset_in) < 0) + goto error; + + + /*------------------------------------------------------------------------- + * check if we should use H5Ocopy or not + * if there is a request for filters/layout, we read/write the object + * otherwise we do a copy using H5Ocopy + *------------------------------------------------------------------------- + */ + if ( options->op_tbl->nelems || + options->all_filter == 1 || + options->all_layout == 1 || + is_ref || + is_named) + { + + int j; - /* early detection of references */ if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) goto error; + if((f_space_id = H5Dget_space(dset_in)) < 0) + goto error; if((ftype_id = H5Dget_type(dset_in)) < 0) goto error; - if(H5T_REFERENCE == H5Tget_class(ftype_id)) - is_ref = 1; - if(H5Tclose(ftype_id) < 0) + if((dcpl_id = H5Dget_create_plist(dset_in)) < 0) goto error; - if(H5Dclose(dset_in) < 0) + if((dcpl_out = H5Pcopy(dcpl_id)) < 0) goto error; - - - /*------------------------------------------------------------------------- - * check if we should use H5Ocopy or not - * if there is a request for filters/layout, we read/write the object - * otherwise we do a copy using H5Ocopy - *------------------------------------------------------------------------- - */ - if ( options->op_tbl->nelems || - options->all_filter == 1 || - options->all_layout == 1 || - is_ref) + if((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0) + goto error; + HDmemset(dims, 0, sizeof dims); + if(H5Sget_simple_extent_dims(f_space_id, dims, NULL) < 0) + goto error; + nelmts = 1; + for ( j = 0; j < rank; j++) { - - int j; - - if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) - goto error; - if((f_space_id = H5Dget_space(dset_in)) < 0) - goto error; - if((ftype_id = H5Dget_type(dset_in)) < 0) - goto error; - if((dcpl_id = H5Dget_create_plist(dset_in)) < 0) - goto error; - if((dcpl_out = H5Pcopy(dcpl_id)) < 0) - goto error; - if((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0) - goto error; - HDmemset(dims, 0, sizeof dims); - if(H5Sget_simple_extent_dims(f_space_id, dims, NULL) < 0) - goto error; - nelmts = 1; - for ( j = 0; j < rank; j++) - { - nelmts *= dims[j]; - } + nelmts *= dims[j]; + } + /* wtype_id will have already been set if using a named dtype */ + if(!is_named) { if(options->use_native == 1) wtype_id = h5tools_get_native_type(ftype_id); else - wtype_id = H5Tcopy(ftype_id); + wtype_id = H5Tcopy(ftype_id); + } /* end if */ + + if((msize = H5Tget_size(wtype_id)) == 0) + goto error; + + /*------------------------------------------------------------------------- + * check if the dataset creation property list has filters that + * are not registered in the current configuration + * 1) the external filters GZIP and SZIP might not be available + * 2) the internal filters might be turned off + *------------------------------------------------------------------------- + */ + if (h5tools_canreadf((travt->objs[i].name),dcpl_id)==1) + { + apply_s=1; + apply_f=1; - if((msize = H5Tget_size(wtype_id)) == 0) - goto error; - /*------------------------------------------------------------------------- - * check if the dataset creation property list has filters that - * are not registered in the current configuration - * 1) the external filters GZIP and SZIP might not be available - * 2) the internal filters might be turned off - *------------------------------------------------------------------------- - */ - if (h5tools_canreadf((travt->objs[i].name),dcpl_id)==1) + * references are a special case + * we cannot just copy the buffers, but instead we recreate the reference + * in a second traversal of the output file + *------------------------------------------------------------------------- + */ + if (H5T_REFERENCE!=H5Tget_class(wtype_id)) { - apply_s=1; - apply_f=1; + /* get the storage size of the input dataset */ + dsize_in=H5Dget_storage_size(dset_in); + + /* check for datasets too small */ + if (nelmts*msize < options->min_comp ) + apply_s=0; + + /* apply the filter */ + if (apply_s) + { + if (apply_filters(travt->objs[i].name, + rank, + dims, + msize, + dcpl_out, + options, + &has_filter) < 0) + goto error; + } /*------------------------------------------------------------------------- - * references are a special case - * we cannot just copy the buffers, but instead we recreate the reference - * in a second traversal of the output file + * create the output dataset; + * disable error checking in case the dataset cannot be created with the + * modified dcpl; in that case use the original instead *------------------------------------------------------------------------- */ - if (H5T_REFERENCE!=H5Tget_class(wtype_id)) + H5E_BEGIN_TRY { + dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_out, H5P_DEFAULT); + } H5E_END_TRY; + + if(dset_out == FAIL) { - /* get the storage size of the input dataset */ - dsize_in=H5Dget_storage_size(dset_in); + if(options->verbose) + printf(" warning: could not create dataset <%s>. Applying original settings\n", + travt->objs[i].name); - /* check for datasets too small */ - if (nelmts*msize < options->min_comp ) - apply_s=0; + if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) + goto error; + apply_f = 0; + } - /* apply the filter */ - if (apply_s) - { - if (apply_filters(travt->objs[i].name, - rank, - dims, - msize, - dcpl_out, - options, - &has_filter) < 0) - goto error; - } + /*------------------------------------------------------------------------- + * read/write + *------------------------------------------------------------------------- + */ + if (nelmts) + { + size_t need = (size_t)(nelmts*msize); /* bytes needed */ + if ( need < H5TOOLS_MALLOCSIZE ) + buf = HDmalloc(need); - /*------------------------------------------------------------------------- - * create the output dataset; - * disable error checking in case the dataset cannot be created with the - * modified dcpl; in that case use the original instead - *------------------------------------------------------------------------- - */ - H5E_BEGIN_TRY { - dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_out, H5P_DEFAULT); - } H5E_END_TRY; - - if(dset_out == FAIL) + if (buf != NULL ) { - if(options->verbose) - printf(" warning: could not create dataset <%s>. Applying original settings\n", - travt->objs[i].name); - - if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) + if (H5Dread(dset_in,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) goto error; - apply_f = 0; - } + if (H5Dwrite(dset_out,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) + goto error; + } - /*------------------------------------------------------------------------- - * read/write - *------------------------------------------------------------------------- - */ - if (nelmts) + else /* possibly not enough memory, read/write by hyperslabs */ { - size_t need = (size_t)(nelmts*msize); /* bytes needed */ - if ( need < H5TOOLS_MALLOCSIZE ) - buf = HDmalloc(need); + size_t p_type_nbytes = msize; /*size of memory type */ + hsize_t p_nelmts = nelmts; /*total selected elmts */ + hsize_t elmtno; /*counter */ + int carry; /*counter carry value */ + unsigned int vl_data = 0; /*contains VL datatypes */ + + /* stripmine info */ + hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ + hsize_t sm_nbytes; /*bytes per stripmine */ + hsize_t sm_nelmts; /*elements per stripmine*/ + hid_t sm_space; /*stripmine data space */ + + /* hyperslab info */ + hsize_t hs_offset[H5S_MAX_RANK];/*starting offset */ + hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */ + hsize_t hs_nelmts; /*elements in request */ + hsize_t zero[8]; /*vector of zeros */ + int k; + + /* check if we have VL data in the dataset's datatype */ + if (H5Tdetect_class(wtype_id, H5T_VLEN) == TRUE) + vl_data = TRUE; + + /* + * determine the strip mine size and allocate a buffer. The strip mine is + * a hyperslab whose size is manageable. + */ + sm_nbytes = p_type_nbytes; - if (buf != NULL ) + for (k = rank; k > 0; --k) { - if (H5Dread(dset_in,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) - goto error; - if (H5Dwrite(dset_out,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) - goto error; - } + hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; + if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ + size = 1; + sm_size[k - 1] = MIN(dims[k - 1], size); + sm_nbytes *= sm_size[k - 1]; + assert(sm_nbytes > 0); + } + sm_buf = HDmalloc((size_t)sm_nbytes); + + sm_nelmts = sm_nbytes / p_type_nbytes; + sm_space = H5Screate_simple(1, &sm_nelmts, NULL); + + /* the stripmine loop */ + memset(hs_offset, 0, sizeof hs_offset); + memset(zero, 0, sizeof zero); - else /* possibly not enough memory, read/write by hyperslabs */ + for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { - size_t p_type_nbytes = msize; /*size of memory type */ - hsize_t p_nelmts = nelmts; /*total selected elmts */ - hsize_t elmtno; /*counter */ - int carry; /*counter carry value */ - unsigned int vl_data = 0; /*contains VL datatypes */ - - /* stripmine info */ - hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ - hsize_t sm_nbytes; /*bytes per stripmine */ - hsize_t sm_nelmts; /*elements per stripmine*/ - hid_t sm_space; /*stripmine data space */ - - /* hyperslab info */ - hsize_t hs_offset[H5S_MAX_RANK];/*starting offset */ - hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */ - hsize_t hs_nelmts; /*elements in request */ - hsize_t zero[8]; /*vector of zeros */ - int k; - - /* check if we have VL data in the dataset's datatype */ - if (H5Tdetect_class(wtype_id, H5T_VLEN) == TRUE) - vl_data = TRUE; - - /* - * determine the strip mine size and allocate a buffer. The strip mine is - * a hyperslab whose size is manageable. - */ - sm_nbytes = p_type_nbytes; - - for (k = rank; k > 0; --k) + /* calculate the hyperslab size */ + if (rank > 0) { - hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ - size = 1; - sm_size[k - 1] = MIN(dims[k - 1], size); - sm_nbytes *= sm_size[k - 1]; - assert(sm_nbytes > 0); - } - sm_buf = HDmalloc((size_t)sm_nbytes); - - sm_nelmts = sm_nbytes / p_type_nbytes; - sm_space = H5Screate_simple(1, &sm_nelmts, NULL); - - /* the stripmine loop */ - memset(hs_offset, 0, sizeof hs_offset); - memset(zero, 0, sizeof zero); - - for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) - { - /* calculate the hyperslab size */ - if (rank > 0) - { - for (k = 0, hs_nelmts = 1; k < rank; k++) - { - hs_size[k] = MIN(dims[k] - hs_offset[k], sm_size[k]); - hs_nelmts *= hs_size[k]; - } - - if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - goto error; - if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) - goto error; - } - else + for (k = 0, hs_nelmts = 1; k < rank; k++) { - H5Sselect_all(f_space_id); - H5Sselect_all(sm_space); - hs_nelmts = 1; - } /* rank */ + hs_size[k] = MIN(dims[k] - hs_offset[k], sm_size[k]); + hs_nelmts *= hs_size[k]; + } - /* read/write */ - if (H5Dread(dset_in, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf) < 0) + if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) goto error; - if (H5Dwrite(dset_out, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf) < 0) + if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) goto error; + } + else + { + H5Sselect_all(f_space_id); + H5Sselect_all(sm_space); + hs_nelmts = 1; + } /* rank */ - /* reclaim any VL memory, if necessary */ - if(vl_data) - H5Dvlen_reclaim(wtype_id, sm_space, H5P_DEFAULT, sm_buf); + /* read/write */ + if (H5Dread(dset_in, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf) < 0) + goto error; + if (H5Dwrite(dset_out, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf) < 0) + goto error; - /* calculate the next hyperslab offset */ - for (k = rank, carry = 1; k > 0 && carry; --k) - { - hs_offset[k - 1] += hs_size[k - 1]; - if (hs_offset[k - 1] == dims[k - 1]) - hs_offset[k - 1] = 0; - else - carry = 0; - } /* k */ - } /* elmtno */ - - H5Sclose(sm_space); - /* free */ - if (sm_buf!=NULL) + /* reclaim any VL memory, if necessary */ + if(vl_data) + H5Dvlen_reclaim(wtype_id, sm_space, H5P_DEFAULT, sm_buf); + + /* calculate the next hyperslab offset */ + for (k = rank, carry = 1; k > 0 && carry; --k) { - HDfree(sm_buf); - sm_buf=NULL; - } - } /* hyperslab read */ - }/*nelmts*/ - - /*------------------------------------------------------------------------- - * amount of compression used - *------------------------------------------------------------------------- - */ - if (options->verbose) + hs_offset[k - 1] += hs_size[k - 1]; + if (hs_offset[k - 1] == dims[k - 1]) + hs_offset[k - 1] = 0; + else + carry = 0; + } /* k */ + } /* elmtno */ + + H5Sclose(sm_space); + /* free */ + if (sm_buf!=NULL) + { + HDfree(sm_buf); + sm_buf=NULL; + } + } /* hyperslab read */ + }/*nelmts*/ + + /*------------------------------------------------------------------------- + * amount of compression used + *------------------------------------------------------------------------- + */ + if (options->verbose) + { + double ratio=0; + + /* only print the compression ration if there was a filter request */ + if (apply_s && apply_f && req_filter) { - double ratio=0; + hssize_t a, b; - /* only print the compression ration if there was a filter request */ - if (apply_s && apply_f && req_filter) - { - hssize_t a, b; + /* get the storage size of the output dataset */ + dsize_out=H5Dget_storage_size(dset_out); - /* get the storage size of the output dataset */ - dsize_out=H5Dget_storage_size(dset_out); + /* compression ratio = uncompressed size / compressed size */ - /* compression ratio = uncompressed size / compressed size */ + a = dsize_in; b = dsize_out; + if (b!=0) + ratio = (double) a / (double) b; - a = dsize_in; b = dsize_out; - if (b!=0) - ratio = (double) a / (double) b; - - print_dataset_info(dcpl_out,travt->objs[i].name,ratio,1); - } - else - print_dataset_info(dcpl_id,travt->objs[i].name,ratio,0); + print_dataset_info(dcpl_out,travt->objs[i].name,ratio,1); + } + else + print_dataset_info(dcpl_id,travt->objs[i].name,ratio,0); - /* print a message that the filter was not applied - (in case there was a filter) - */ - if ( has_filter && apply_s == 0 ) - printf(" \n", - travt->objs[i].name, - (int)options->min_comp); - - if ( has_filter && apply_f == 0 ) - printf(" \n", - travt->objs[i].name); - - } /* verbose */ - - /*------------------------------------------------------------------------- - * copy attrs - *------------------------------------------------------------------------- - */ - if (copy_attr(dset_in,dset_out,options) < 0) - goto error; + /* print a message that the filter was not applied + (in case there was a filter) + */ + if ( has_filter && apply_s == 0 ) + printf(" \n", + travt->objs[i].name, + (int)options->min_comp); - /*close */ - if (H5Dclose(dset_out) < 0) - goto error; + if ( has_filter && apply_f == 0 ) + printf(" \n", + travt->objs[i].name); - }/*!H5T_REFERENCE*/ - }/*h5tools_canreadf*/ + } /* verbose */ + /*------------------------------------------------------------------------- + * copy attrs + *------------------------------------------------------------------------- + */ + if (copy_attr(dset_in, dset_out, &named_dt_head, travt, options) < 0) + goto error; + + /*close */ + if (H5Dclose(dset_out) < 0) + goto error; + + }/*!H5T_REFERENCE*/ + }/*h5tools_canreadf*/ - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - if (H5Tclose(ftype_id) < 0) - goto error; - if (H5Tclose(wtype_id) < 0) - goto error; - if (H5Pclose(dcpl_id) < 0) - goto error; - if (H5Pclose(dcpl_out) < 0) - goto error; - if (H5Sclose(f_space_id) < 0) - goto error; - if (H5Dclose(dset_in) < 0) - goto error; - } /*------------------------------------------------------------------------- - * we do not have request for filter/chunking use H5Ocopy instead - *------------------------------------------------------------------------- - */ - else - { - hid_t pid; + * close + *------------------------------------------------------------------------- + */ + if (H5Tclose(ftype_id) < 0) + goto error; + if (H5Tclose(wtype_id) < 0) + goto error; + if (H5Pclose(dcpl_id) < 0) + goto error; + if (H5Pclose(dcpl_out) < 0) + goto error; + if (H5Sclose(f_space_id) < 0) + goto error; + if (H5Dclose(dset_in) < 0) + goto error; - /* create property to pass copy options */ - if ( (pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) - goto error; + } + /*------------------------------------------------------------------------- + * we do not have request for filter/chunking use H5Ocopy instead + *------------------------------------------------------------------------- + */ + else + { + hid_t pid; - /* set options for object copy */ - if(H5Pset_copy_object(pid, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) - goto error; + /* create property to pass copy options */ + if ( (pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) + goto error; - /*------------------------------------------------------------------------- - * do the copy - *------------------------------------------------------------------------- - */ - - if(H5Ocopy(fidin, /* Source file or group identifier */ - travt->objs[i].name, /* Name of the source object to be copied */ - fidout, /* Destination file or group identifier */ - travt->objs[i].name, /* Name of the destination object */ - pid, /* Properties which apply to the copy */ - H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */ - goto error; + /* set options for object copy */ + if(H5Pset_copy_object(pid, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) + goto error; - /* close property */ - if(H5Pclose(pid) < 0) - goto error; + /*------------------------------------------------------------------------- + * do the copy + *------------------------------------------------------------------------- + */ + + if(H5Ocopy(fidin, /* Source file or group identifier */ + travt->objs[i].name, /* Name of the source object to be copied */ + fidout, /* Destination file or group identifier */ + travt->objs[i].name, /* Name of the destination object */ + pid, /* Properties which apply to the copy */ + H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */ + goto error; + /* close property */ + if(H5Pclose(pid) < 0) + goto error; + + + /*------------------------------------------------------------------------- + * copy attrs manually + *------------------------------------------------------------------------- + */ + if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) + goto error; + if((dset_out = H5Dopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) + goto error; + if(copy_attr(dset_in, dset_out, &named_dt_head, travt, options) < 0) + goto error; + if(H5Dclose(dset_in) < 0) + goto error; + if(H5Dclose(dset_out) < 0) + goto error; - /*------------------------------------------------------------------------- - * copy attrs manually - *------------------------------------------------------------------------- - */ - if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) - goto error; - if((dset_out = H5Dopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) - goto error; - if(copy_attr(dset_in, dset_out, options) < 0) - goto error; - if(H5Dclose(dset_in) < 0) - goto error; - if(H5Dclose(dset_out) < 0) - goto error; + if (options->verbose) + printf(FORMAT_OBJ,"dset",travt->objs[i].name ); - if (options->verbose) - printf(FORMAT_OBJ,"dset",travt->objs[i].name ); - - } /* end do we have request for filter/chunking */ + } /* end do we have request for filter/chunking */ - break; + break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_NAMED_DATATYPE - *------------------------------------------------------------------------- - */ - case H5TRAV_TYPE_NAMED_DATATYPE: + * H5TRAV_TYPE_NAMED_DATATYPE + *------------------------------------------------------------------------- + */ + case H5TRAV_TYPE_NAMED_DATATYPE: - if(options->verbose) - printf(FORMAT_OBJ, "type", travt->objs[i].name); + if(options->verbose) + printf(FORMAT_OBJ, "type", travt->objs[i].name); - if((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) - goto error; + if((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) + goto error; - if((type_out = H5Tcopy(type_in)) < 0) - goto error; + /* Copy the datatype anonymously */ + if((type_out = copy_named_datatype(type_in, fidout, &named_dt_head, + travt, options)) < 0) + goto error; - if((H5Tcommit2(fidout, travt->objs[i].name, type_out, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + /* Link in to group structure */ + if(H5Lcreate_hard(type_out, ".", fidout, travt->objs[i].name, + H5P_DEFAULT, H5P_DEFAULT) < 0) + goto error; - /*------------------------------------------------------------------------- - * copy attrs - *------------------------------------------------------------------------- - */ - if(copy_attr(type_in, type_out, options) < 0) - goto error; + /*------------------------------------------------------------------------- + * copy attrs + *------------------------------------------------------------------------- + */ + if(copy_attr(type_in, type_out, &named_dt_head, travt, options) < 0) + goto error; - if(H5Tclose(type_in) < 0) - goto error; - if(H5Tclose(type_out) < 0) - goto error; + if(H5Tclose(type_in) < 0) + goto error; + if(H5Tclose(type_out) < 0) + goto error; - - break; + + break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_LINK - * H5TRAV_TYPE_UDLINK - * - * Only handles external links; H5Lcopy will fail for other UD link types - * since we don't have creation or copy callbacks for them. - *------------------------------------------------------------------------- - */ - - case H5TRAV_TYPE_LINK: - case H5TRAV_TYPE_UDLINK: + * H5TRAV_TYPE_LINK + * H5TRAV_TYPE_UDLINK + * + * Only handles external links; H5Lcopy will fail for other UD link types + * since we don't have creation or copy callbacks for them. + *------------------------------------------------------------------------- + */ + + case H5TRAV_TYPE_LINK: + case H5TRAV_TYPE_UDLINK: { if(options->verbose) @@ -1055,8 +1116,8 @@ int do_copy_objects(hid_t fidin, } break; - default: - goto error; + default: + goto error; } /* switch */ /* free */ @@ -1068,6 +1129,9 @@ int do_copy_objects(hid_t fidin, } /* i */ + /* Finalize (link) the stack of named datatypes (if any) */ + named_datatype_free(&named_dt_head, 0); + return 0; error: @@ -1075,7 +1139,8 @@ error: H5Gclose(grp_in); H5Gclose(grp_out); H5Pclose(dcpl_id); - H5Pclose(gcpl_id); + H5Pclose(gcpl_in); + H5Pclose(gcpl_out); H5Sclose(f_space_id); H5Dclose(dset_in); H5Dclose(dset_out); @@ -1083,6 +1148,7 @@ error: H5Tclose(wtype_id); H5Tclose(type_in); H5Tclose(type_out); + named_datatype_free(&named_dt_head, 1); } H5E_END_TRY; /* free */ if (buf!=NULL) @@ -1094,24 +1160,26 @@ error: /*------------------------------------------------------------------------- - * Function: copy_attr - * - * Purpose: copy attributes located in LOC_IN, which is obtained either from - * loc_id = H5Gopen2( fid, name); - * loc_id = H5Dopen2( fid, name); - * loc_id = H5Topen2( fid, name); - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October, 28, 2003 - * - *------------------------------------------------------------------------- - */ +* Function: copy_attr +* +* Purpose: copy attributes located in LOC_IN, which is obtained either from +* loc_id = H5Gopen2( fid, name); +* loc_id = H5Dopen2( fid, name); +* loc_id = H5Topen2( fid, name); +* +* Return: 0, ok, -1 no +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: October, 28, 2003 +* +*------------------------------------------------------------------------- +*/ int copy_attr(hid_t loc_in, hid_t loc_out, + named_dt_t **named_dt_head_p, + trav_table_t *travt, pack_opt_t *options ) { @@ -1124,76 +1192,101 @@ int copy_attr(hid_t loc_in, void *buf=NULL; /* data buffer */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ + htri_t is_named; /* Whether the datatype is named */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ char name[255]; H5O_info_t oinfo; /* object info */ int j; unsigned u; - + if(H5Oget_info(loc_in, &oinfo) < 0) goto error; - - /*------------------------------------------------------------------------- + + /*------------------------------------------------------------------------- * copy all attributes *------------------------------------------------------------------------- */ - + for ( u = 0; u < (unsigned)oinfo.num_attrs; u++) { - + buf=NULL; - + /* open attribute */ if((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - + /* get name */ if (H5Aget_name( attr_id, (size_t)255, name ) < 0) goto error; - + /* get the file datatype */ if ((ftype_id = H5Aget_type( attr_id )) < 0 ) goto error; - + + /* Check if the datatype is committed */ + if((is_named = H5Tcommitted(ftype_id)) < 0) + goto error; + if(is_named) { + hid_t fidout; + + /* Create out file id */ + if((fidout = H5Iget_file_id(loc_out)) < 0) + goto error; + + /* Copy named dt */ + if((wtype_id = copy_named_datatype(ftype_id, fidout, named_dt_head_p, + travt, options)) < 0) { + H5Fclose(fidout); + goto error; + } /* end if */ + + if(H5Fclose(fidout) < 0) + goto error; + } /* end if */ + /* get the dataspace handle */ if ((space_id = H5Aget_space( attr_id )) < 0 ) goto error; - + /* get dimensions */ if ( (rank = H5Sget_simple_extent_dims(space_id, dims, NULL)) < 0 ) goto error; - + nelmts=1; for (j=0; juse_native==1) - wtype_id = h5tools_get_native_type(ftype_id); - else - wtype_id = H5Tcopy(ftype_id); - + + /* wtype_id will have already been set if using a named dtype */ + if(!is_named) { + if (options->use_native==1) + wtype_id = h5tools_get_native_type(ftype_id); + else + wtype_id = H5Tcopy(ftype_id); + } /* end if */ + if ((msize=H5Tget_size(wtype_id))==0) goto error; - - /*------------------------------------------------------------------------- + + /*------------------------------------------------------------------------- * object references are a special case * we cannot just copy the buffers, but instead we recreate the reference * this is done on a second sweep of the file that just copies * the referenced objects *------------------------------------------------------------------------- */ - + if (H5T_REFERENCE==H5Tget_class(wtype_id)) { ; } else { - /*------------------------------------------------------------------------- - * read to memory - *------------------------------------------------------------------------- - */ - + /*------------------------------------------------------------------------- + * read to memory + *------------------------------------------------------------------------- + */ + buf = (void *)HDmalloc((size_t)(nelmts * msize)); if(buf == NULL) { error_msg(progname, "cannot read into memory\n" ); @@ -1201,46 +1294,46 @@ int copy_attr(hid_t loc_in, } if(H5Aread(attr_id, wtype_id, buf) < 0) goto error; - - /*------------------------------------------------------------------------- + + /*------------------------------------------------------------------------- * copy *------------------------------------------------------------------------- */ - - if((attr_out = H5Acreate2(loc_out, name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) + + if((attr_out = H5Acreate2(loc_out, name, wtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Awrite(attr_out, wtype_id, buf) < 0) goto error; - + /*close*/ if(H5Aclose(attr_out) < 0) goto error; - - + + if(buf) free(buf); - + } /*H5T_REFERENCE*/ - - + + if(options->verbose) printf(FORMAT_OBJ_ATTR, "attr", name); - + /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - + * close + *------------------------------------------------------------------------- + */ + if (H5Tclose(ftype_id) < 0) goto error; if (H5Tclose(wtype_id) < 0) goto error; if (H5Sclose(space_id) < 0) goto error; if (H5Aclose(attr_id) < 0) goto error; - + } /* u */ - - + + return 0; - + error: H5E_BEGIN_TRY { H5Tclose(ftype_id); @@ -1255,15 +1348,13 @@ error: } - - /*------------------------------------------------------------------------- - * Function: print_dataset_info - * - * Purpose: print name, filters, percentage compression of a dataset - * - *------------------------------------------------------------------------- - */ +* Function: print_dataset_info +* +* Purpose: print name, filters, percentage compression of a dataset +* +*------------------------------------------------------------------------- +*/ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, @@ -1280,27 +1371,27 @@ static void print_dataset_info(hid_t dcpl_id, size_t cd_nelmts; /* filter client number of values */ char f_objname[256]; /* filter objname */ int i; - - + + strcpy(strfilter,"\0"); - + /* get information about input filters */ if((nfilters = H5Pget_nfilters(dcpl_id)) < 0) return; - + for(i = 0; i < nfilters; i++) { cd_nelmts = NELMTS(cd_values); - + filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_objname), f_objname, NULL); - + switch(filtn) { default: break; - + case H5Z_FILTER_DEFLATE: strcat(strfilter,"GZIP "); - + #if defined (PRINT_DEBUG) { unsigned level=cd_values[0]; @@ -1309,10 +1400,10 @@ static void print_dataset_info(hid_t dcpl_id, } #endif break; - + case H5Z_FILTER_SZIP: strcat(strfilter,"SZIP "); - + #if defined (PRINT_DEBUG) { unsigned options_mask=cd_values[0]; /* from dcpl, not filt*/ @@ -1325,29 +1416,29 @@ static void print_dataset_info(hid_t dcpl_id, strcpy(temp,"NN) "); } strcat(strfilter,temp); - + #endif - + break; - + case H5Z_FILTER_SHUFFLE: strcat(strfilter,"SHUF "); break; - + case H5Z_FILTER_FLETCHER32: strcat(strfilter,"FLET "); break; - + case H5Z_FILTER_NBIT: strcat(strfilter,"NBIT "); break; - + case H5Z_FILTER_SCALEOFFSET: strcat(strfilter,"SCALEOFFSET "); break; } /* switch */ }/*i*/ - + if(!pr) printf(FORMAT_OBJ,"dset",objname ); else @@ -1361,19 +1452,152 @@ static void print_dataset_info(hid_t dcpl_id, } } + /*------------------------------------------------------------------------- - * Function: copy_user_block - * - * Purpose: copy user block from one file to another - * - * Return: 0, ok, -1 no - * - * Programmer: Peter Cao - * - * Date: October, 25, 2007 - * - *------------------------------------------------------------------------- - */ +* Function: copy_named_datatype +* +* Purpose: Copies the specified datatype anonymously, and returns an open +* id for that datatype in the output file. The first time this +* is called it scans every named datatype in travt into a +* private stack, afterwards it simply scans that stack. The id +* returned must be closed after it is no longer needed. +* named_datatype_free must be called before the program exits +* to free the stack. +* +* Programmer: Neil Fortner +* +* Date: April 14, 2009 +* +*------------------------------------------------------------------------- +*/ +static hid_t +copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) +{ + named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ + named_dt_t *dt_ret = NULL; /* Datatype to return */ + H5O_info_t oinfo; /* Object info of input dtype */ + hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ + + if(H5Oget_info(type_in, &oinfo) < 0) + goto error; + + if(*named_dt_head_p) { + /* Stack already exists, search for the datatype */ + while(dt && dt->addr_in != oinfo.addr) + dt = dt->next; + + dt_ret = dt; + } else { + /* Create the stack */ + size_t i; + + for(i=0; inobjs; i++) + if(travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { + /* Push onto the stack */ + if(NULL == (dt = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) + goto error; + dt->next = *named_dt_head_p; + *named_dt_head_p = dt; + + /* Update the address and id */ + dt->addr_in = travt->objs[i].objno; + dt->id_out = -1; + + /* Check if this type is the one requested */ + if(oinfo.addr == dt->addr_in) { + HDassert(!dt_ret); + dt_ret = dt; + } /* end if */ + } /* end if */ + } /* end else */ + + /* Handle the case that the requested datatype was not found. This is + * possible if the datatype was committed anonymously in the input file. */ + if(!dt_ret) { + /* Push the new datatype onto the stack */ + if(NULL == (dt_ret = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) + goto error; + dt_ret->next = *named_dt_head_p; + *named_dt_head_p = dt_ret; + + /* Update the address and id */ + dt_ret->addr_in = oinfo.addr; + dt_ret->id_out = -1; + } /* end if */ + + /* If the requested datatype does not yet exist in the output file, copy it + * anonymously */ + if(dt_ret->id_out < 0) { + if (options->use_native==1) + dt_ret->id_out = h5tools_get_native_type(type_in); + else + dt_ret->id_out = H5Tcopy(type_in); + if(dt_ret->id_out < 0) + goto error; + if(H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto error; + } /* end if */ + + /* Set return value */ + ret_value = dt_ret->id_out; + + /* Increment the ref count on id_out, because the calling function will try + * to close it */ + if(H5Iinc_ref(ret_value) < 0) + goto error; + + return(ret_value); + +error: + return(-1); +} /* end copy_named_datatype */ + + +/*------------------------------------------------------------------------- +* Function: named_datatype_free +* +* Purpose: Frees the stack of named datatypes. +* +* Programmer: Neil Fortner +* +* Date: April 14, 2009 +* +*------------------------------------------------------------------------- +*/ +static int +named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) +{ + named_dt_t *dt = *named_dt_head_p; + + while(dt) { + /* Pop the datatype off the stack and free it */ + if(H5Tclose(dt->id_out) < 0 && !ignore_err) + goto error; + dt = dt->next; + HDfree(*named_dt_head_p); + *named_dt_head_p = dt; + } /* end while */ + + return 0; + +error: + return -1; +} /* end named_datatype_free */ + + +/*------------------------------------------------------------------------- +* Function: copy_user_block +* +* Purpose: copy user block from one file to another +* +* Return: 0, ok, -1 no +* +* Programmer: Peter Cao +* +* Date: October, 25, 2007 +* +*------------------------------------------------------------------------- +*/ static int copy_user_block(const char *infile, const char *outfile, hsize_t size) { @@ -1448,18 +1672,18 @@ done: /*------------------------------------------------------------------------- - * Function: print_user_block - * - * Purpose: print user block - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente - * - * Date: August, 20, 2008 - * - *------------------------------------------------------------------------- - */ +* Function: print_user_block +* +* Purpose: print user block +* +* Return: 0, ok, -1 no +* +* Programmer: Pedro Vicente +* +* Date: August, 20, 2008 +* +*------------------------------------------------------------------------- +*/ #if defined (H5REPACK_DEBUG_USER_BLOCK) static void print_user_block(const char *filename, hid_t fid) @@ -1476,25 +1700,25 @@ void print_user_block(const char *filename, hid_t fid) error_msg(progname, "failed to retrieve file creation property list\n"); goto done; } - + if(H5Pget_userblock(fcpl, &ub_size) < 0) { error_msg(progname, "failed to retrieve userblock size\n"); goto done; } - + if(H5Pclose(fcpl) < 0) { error_msg(progname, "failed to close property list\n"); goto done; } - + /* open file */ if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { goto done; } - + size = ub_size; /* read file */ @@ -1522,7 +1746,7 @@ void print_user_block(const char *filename, hid_t fid) goto done; } - + /* update size of userblock left to transfer */ size -= nread; } @@ -1530,7 +1754,7 @@ void print_user_block(const char *filename, hid_t fid) done: if(fh > 0) HDclose(fh); - + return; } diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index cfd867a..00d7c66 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -98,6 +98,11 @@ int aux_assign_obj(const char* name, /* object name from traverse lis for ( i=0; ichunk_g.chunk_lengths[i]; break; + case H5D_LAYOUT_ERROR: + case H5D_COMPACT: + case H5D_CONTIGUOUS: + case H5D_NLAYOUTS: + break; default: break; }/*switch*/ @@ -112,6 +117,11 @@ int aux_assign_obj(const char* name, /* object name from traverse lis for ( i=0; iop_tbl->objs[idx].chunk.chunk_lengths[i]; break; + case H5D_LAYOUT_ERROR: + case H5D_COMPACT: + case H5D_CONTIGUOUS: + case H5D_NLAYOUTS: + break; default: break; }/*switch*/ @@ -163,6 +173,11 @@ int aux_assign_obj(const char* name, /* object name from traverse lis for ( i=0; ichunk_g.chunk_lengths[i]; break; + case H5D_LAYOUT_ERROR: + case H5D_COMPACT: + case H5D_CONTIGUOUS: + case H5D_NLAYOUTS: + break; default: break; }/*switch*/ diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index d684da8..154d6e5 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -95,7 +95,7 @@ obj_list_t* parse_filter(const char *str, } n++; - obj_list = malloc(n*sizeof(obj_list_t)); + obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { error_msg(progname, "could not allocate object list\n"); @@ -446,6 +446,8 @@ obj_list_t* parse_filter(const char *str, exit(1); } break; + default: + break; }; @@ -514,7 +516,7 @@ obj_list_t* parse_layout(const char *str, } n++; - obj_list=malloc(n*sizeof(obj_list_t)); + obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { error_msg(progname, "could not allocate object list\n"); diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 82e8250..cd725cd 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -74,7 +74,8 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ for(i = 0; i < travt->nobjs; i++) { - switch(travt->objs[i].type) { + switch(travt->objs[i].type) + { /*------------------------------------------------------------------------- * H5TRAV_TYPE_GROUP *------------------------------------------------------------------------- @@ -165,7 +166,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if(nelmts) { - buf = (void *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf==NULL) { printf("cannot read into memory\n" ); goto error; @@ -173,7 +174,7 @@ int do_copy_refobjs(hid_t fidin, if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; - refbuf = HDcalloc((unsigned)nelmts, msize); + refbuf = (hobj_ref_t*) HDcalloc((unsigned)nelmts, msize); if(refbuf == NULL){ printf("cannot allocate memory\n" ); goto error; @@ -237,7 +238,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if(nelmts) { - buf = (void *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) { printf("cannot read into memory\n"); goto error; @@ -249,7 +250,7 @@ int do_copy_refobjs(hid_t fidin, * create output *------------------------------------------------------------------------- */ - refbuf = HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ + refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { printf("cannot allocate memory\n"); goto error; @@ -370,6 +371,10 @@ int do_copy_refobjs(hid_t fidin, /*nothing to do */ break; + case H5TRAV_TYPE_UNKNOWN: + case H5TRAV_TYPE_UDLINK: + goto error; + default: break; } /* end switch */ @@ -436,7 +441,8 @@ static int copy_refs_attr(hid_t loc_in, if(H5Oget_info(loc_in, &oinfo) < 0) goto error; - for(u = 0; u < (unsigned)oinfo.num_attrs; u++) { + for(u = 0; u < (unsigned)oinfo.num_attrs; u++) + { /*------------------------------------------------------------------------- * open *------------------------------------------------------------------------- @@ -482,7 +488,8 @@ static int copy_refs_attr(hid_t loc_in, * we cannot just copy the buffers, but instead we recreate the reference *------------------------------------------------------------------------- */ - if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { + if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) + { hid_t refobj_id; hobj_ref_t *refbuf = NULL; unsigned k; @@ -494,23 +501,28 @@ static int copy_refs_attr(hid_t loc_in, *------------------------------------------------------------------------- */ - if (nelmts) { - buf = (void *)HDmalloc((unsigned)(nelmts * msize)); - if(buf == NULL) { + if (nelmts) + { + buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + if(buf == NULL) + { printf("cannot read into memory\n"); goto error; } /* end if */ if(H5Aread(attr_id, mtype_id, buf) < 0) goto error; - refbuf = HDcalloc((unsigned)nelmts, msize); - if(refbuf == NULL) { + refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize); + if(refbuf == NULL) + { printf( "cannot allocate memory\n" ); goto error; } /* end if */ - for(k = 0; k < nelmts; k++) { - H5E_BEGIN_TRY { + for(k = 0; k < nelmts; k++) + { + H5E_BEGIN_TRY + { if((refobj_id = H5Rdereference(attr_id, H5R_OBJECT, &buf[k])) < 0) goto error; } H5E_END_TRY; @@ -518,7 +530,8 @@ static int copy_refs_attr(hid_t loc_in, /* get the name. a valid name could only occur in the * second traversal of the file */ - if((refname = MapIdToName(refobj_id, travt)) != NULL) { + if((refname = MapIdToName(refobj_id, travt)) != NULL) + { /* create the reference */ if(H5Rcreate(&refbuf[k], fidout, refname, H5R_OBJECT, -1) < 0) goto error; @@ -552,7 +565,8 @@ static int copy_refs_attr(hid_t loc_in, * dataset region references *------------------------------------------------------------------------- */ - else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { + else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) + { hid_t refobj_id; hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */ hdset_reg_ref_t *buf = NULL; /* output buffer */ @@ -563,9 +577,11 @@ static int copy_refs_attr(hid_t loc_in, * read input to memory *------------------------------------------------------------------------- */ - if(nelmts) { - buf = (void *)HDmalloc((unsigned)(nelmts * msize)); - if(buf == NULL) { + if(nelmts) + { + buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + if(buf == NULL) + { printf( "cannot read into memory\n" ); goto error; } /* end if */ @@ -576,14 +592,17 @@ static int copy_refs_attr(hid_t loc_in, * create output *------------------------------------------------------------------------- */ - refbuf = HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ - if(refbuf == NULL) { + refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ + if(refbuf == NULL) + { printf( "cannot allocate memory\n" ); goto error; } /* end if */ - for(k = 0; k < nelmts; k++) { - H5E_BEGIN_TRY { + for(k = 0; k < nelmts; k++) + { + H5E_BEGIN_TRY + { if((refobj_id = H5Rdereference(attr_id, H5R_DATASET_REGION, &buf[k])) < 0) continue; } H5E_END_TRY; @@ -591,7 +610,8 @@ static int copy_refs_attr(hid_t loc_in, /* get the name. a valid name could only occur in the * second traversal of the file */ - if((refname = MapIdToName(refobj_id, travt)) != NULL) { + if((refname = MapIdToName(refobj_id, travt)) != NULL) + { hid_t region_id; /* region id of the referenced dataset */ if((region_id = H5Rget_region(attr_id, H5R_DATASET_REGION, &buf[k])) < 0) @@ -616,8 +636,10 @@ static int copy_refs_attr(hid_t loc_in, if((attr_out = H5Acreate2(loc_out, name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(nelmts) + { if(H5Awrite(attr_out, mtype_id, refbuf) < 0) goto error; + } if(H5Aclose(attr_out) < 0) goto error; @@ -670,8 +692,10 @@ static const char* MapIdToName(hid_t refobj_id, unsigned int i; /* linear search */ - for(i = 0; i < travt->nobjs; i++) { - if(travt->objs[i].type == H5O_TYPE_DATASET) { + for(i = 0; i < travt->nobjs; i++) + { + if(travt->objs[i].type == H5O_TYPE_DATASET) + { H5O_info_t ref_oinfo; /* Stat for the refobj id */ /* obtain information to identify the referenced object uniquely */ diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index a7454d6..92d758e 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -275,7 +275,7 @@ int has_layout(hid_t pid, } /*------------------------------------------------------------------------- - * Function: h5repack_cmpdcpl + * Function: h5repack_cmp_pl * * Purpose: compare 2 files for identical property lists of all objects * @@ -288,17 +288,20 @@ int has_layout(hid_t pid, *------------------------------------------------------------------------- */ -int h5repack_cmpdcpl(const char *fname1, +int h5repack_cmp_pl(const char *fname1, const char *fname2) { - hid_t fid1=-1; /* file ID */ - hid_t fid2=-1; /* file ID */ - hid_t dset1=-1; /* dataset ID */ - hid_t dset2=-1; /* dataset ID */ - hid_t dcpl1=-1; /* dataset creation property list ID */ - hid_t dcpl2=-1; /* dataset creation property list ID */ - trav_table_t *travt1=NULL; - trav_table_t *travt2=NULL; + hid_t fid1=-1; /* file ID */ + hid_t fid2=-1; /* file ID */ + hid_t dset1=-1; /* dataset ID */ + hid_t dset2=-1; /* dataset ID */ + hid_t gid=-1; /* group ID */ + hid_t dcpl1=-1; /* dataset creation property list ID */ + hid_t dcpl2=-1; /* dataset creation property list ID */ + hid_t gcplid=-1; /* group creation property list */ + unsigned crt_order_flag1; /* group creation order flag */ + unsigned crt_order_flag2; /* group creation order flag */ + trav_table_t *trav=NULL; int ret=1; unsigned int i; @@ -330,26 +333,57 @@ int h5repack_cmpdcpl(const char *fname1, * get file table list of objects *------------------------------------------------------------------------- */ - trav_table_init(&travt1); - trav_table_init(&travt2); - if(h5trav_gettable(fid1, travt1) < 0) + trav_table_init(&trav); + if(h5trav_gettable(fid1, trav) < 0) goto error; - if(h5trav_gettable(fid2, travt2) < 0) - goto error; - - + /*------------------------------------------------------------------------- * traverse the suppplied object list *------------------------------------------------------------------------- */ - - for(i = 0; i < travt1->nobjs; i++) + for(i = 0; i < trav->nobjs; i++) { - if(travt1->objs[i].type == H5TRAV_TYPE_DATASET) + + if(trav->objs[i].type == H5TRAV_TYPE_GROUP) + { + + if ((gid = H5Gopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0) + goto error; + if ((gcplid = H5Gget_create_plist(gid)) < 0) + goto error; + if (H5Pget_link_creation_order(gcplid, &crt_order_flag1) < 0) + goto error; + if (H5Pclose(gcplid) < 0) + goto error; + if (H5Gclose(gid) < 0) + goto error; + + if ((gid = H5Gopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0) + goto error; + if ((gcplid = H5Gget_create_plist(gid)) < 0) + goto error; + if (H5Pget_link_creation_order(gcplid, &crt_order_flag2) < 0) + goto error; + if (H5Pclose(gcplid) < 0) + goto error; + if (H5Gclose(gid) < 0) + goto error; + + if ( crt_order_flag1 != crt_order_flag2 ) + { + error_msg(progname, "property lists for <%s> are different\n",trav->objs[i].name); + goto error; + } + + } + + + + else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) { - if((dset1 = H5Dopen2(fid1, travt1->objs[i].name, H5P_DEFAULT)) < 0) + if((dset1 = H5Dopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0) goto error; - if((dset2 = H5Dopen2(fid2, travt1->objs[i].name, H5P_DEFAULT)) < 0) + if((dset2 = H5Dopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0) goto error; if((dcpl1 = H5Dget_create_plist(dset1)) < 0) goto error; @@ -365,7 +399,7 @@ int h5repack_cmpdcpl(const char *fname1, if(ret == 0) { - error_msg(progname, "property lists for <%s> are different\n",travt1->objs[i].name); + error_msg(progname, "property lists for <%s> are different\n",trav->objs[i].name); goto error; } @@ -389,8 +423,7 @@ int h5repack_cmpdcpl(const char *fname1, *------------------------------------------------------------------------- */ - trav_table_free(travt1); - trav_table_free(travt2); + trav_table_free(trav); /*------------------------------------------------------------------------- * close @@ -415,8 +448,9 @@ error: H5Dclose(dset2); H5Fclose(fid1); H5Fclose(fid2); - trav_table_free(travt1); - trav_table_free(travt2); + H5Pclose(gcplid); + H5Gclose(gid); + trav_table_free(trav); } H5E_END_TRY; return -1; diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index c6afce1..af4d671 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" #include "h5test.h" @@ -40,9 +40,11 @@ #define FNAME5 "h5repack_early.h5" #define FNAME5OUT "h5repack_early_out.h5" #define FNAME6 "h5repack_early2.h5" +#ifdef H5_HAVE_FILTER_SZIP /* SZIP filter */ #define FNAME7 "h5repack_szip.h5" #define FNAME7OUT "h5repack_szip_out.h5" +#endif /* GZIP filter */ #define FNAME8 "h5repack_deflate.h5" #define FNAME8OUT "h5repack_deflate_out.h5" @@ -70,13 +72,16 @@ /* File w/userblock */ #define FNAME16 "h5repack_ub.h5" #define FNAME16OUT "h5repack_ub_out.h5" +/* Named datatypes */ +#define FNAME17 "h5repack_named_dtypes.h5" +#define FNAME17OUT "h5repack_named_dtypes_out.h5" #define FNAME_UB "ublock.bin" const char *H5REPACK_FILENAMES[] = { - "h5repack_big_out", + "h5repack_big_out", NULL }; @@ -92,57 +97,57 @@ int d_status = EXIT_SUCCESS; #define CDIM1 DIM1/2 #define CDIM2 DIM2/2 #define RANK 2 -#define GBLL ((unsigned long long) 1024*1024*1024) /* Size of userblock (for userblock test) */ #define USERBLOCK_SIZE 2048 /*------------------------------------------------------------------------- - * prototypes - *------------------------------------------------------------------------- - */ -int make_all_objects(hid_t loc_id); -int make_attributes(hid_t loc_id); -int make_hlinks(hid_t loc_id); -int make_early(void); -int make_layout(hid_t loc_id); +* prototypes +*------------------------------------------------------------------------- +*/ +static int make_all_objects(hid_t loc_id); +static int make_attributes(hid_t loc_id); +static int make_hlinks(hid_t loc_id); +static int make_early(void); +static int make_layout(hid_t loc_id); #ifdef H5_HAVE_FILTER_SZIP -int make_szip(hid_t loc_id); +static int make_szip(hid_t loc_id); #endif /* H5_HAVE_FILTER_SZIP */ -int make_deflate(hid_t loc_id); -int make_shuffle(hid_t loc_id); -int make_fletcher32(hid_t loc_id); -int make_nbit(hid_t loc_id); -int make_scaleoffset(hid_t loc_id); -int make_all(hid_t loc_id); -int make_fill(hid_t loc_id); -int make_big(hid_t loc_id); -int make_testfiles(void); -void write_dset_in(hid_t loc_id,const char* dset_name,hid_t file_id,int make_diffs ); -void write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs ); -int write_dset(hid_t loc_id,int rank,hsize_t *dims,const char *dset_name,hid_t type_id,void *buf ); -int make_dset(hid_t loc_id,const char *name,hid_t sid,hid_t dcpl,void *buf); -int make_attr(hid_t loc_id,int rank,hsize_t *dims,const char *attr_name,hid_t type_id,void *buf); -void make_dset_reg_ref(hid_t loc_id); -int make_external(hid_t loc_id); +static int make_deflate(hid_t loc_id); +static int make_shuffle(hid_t loc_id); +static int make_fletcher32(hid_t loc_id); +static int make_nbit(hid_t loc_id); +static int make_scaleoffset(hid_t loc_id); +static int make_all_filters(hid_t loc_id); +static int make_fill(hid_t loc_id); +static int make_big(hid_t loc_id); +static int make_testfiles(void); +static int write_dset_in(hid_t loc_id,const char* dset_name,hid_t file_id,int make_diffs ); +static int write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs ); +static int write_dset(hid_t loc_id,int rank,hsize_t *dims,const char *dset_name,hid_t tid,void *buf ); +static int make_dset(hid_t loc_id,const char *name,hid_t sid,hid_t dcpl,void *buf); +static int make_attr(hid_t loc_id,int rank,hsize_t *dims,const char *attr_name,hid_t tid,void *buf); +static int make_dset_reg_ref(hid_t loc_id); +static int make_external(hid_t loc_id); static int make_userblock(void); static int verify_userblock( const char* filename); static int make_userblock_file(void); +static int make_named_dtype(hid_t loc_id); /*------------------------------------------------------------------------- - * Function: main - * - * Purpose: Executes h5repack tests - * - * Return: Success: zero - * Failure: 1 - * - * Programmer: Pedro Vicente - * January, 6, 2004 - * - *------------------------------------------------------------------------- - */ +* Function: main +* +* Purpose: Executes h5repack tests +* +* Return: Success: zero +* Failure: 1 +* +* Programmer: Pedro Vicente +* January, 6, 2004 +* +*------------------------------------------------------------------------- +*/ int main (void) { @@ -151,20 +156,20 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) int szip_can_encode = 0; #endif - + /* initialize */ memset(&diff_options, 0, sizeof (diff_opt_t)); memset(&pack_options, 0, sizeof (pack_opt_t)); - + /* run tests */ puts("Testing h5repack:"); - + /* make the test files */ TESTING(" generating datasets"); if (make_testfiles() < 0) GOERROR; PASSED(); - + /*------------------------------------------------------------------------- * Format of the tests: * @@ -177,7 +182,7 @@ int main (void) * file with fill values *------------------------------------------------------------------------- */ - + TESTING(" copy of datasets (fill values)"); if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -187,7 +192,7 @@ int main (void) GOERROR; if (h5repack_verify(FNAME0OUT,&pack_options)<=0) GOERROR; - if (h5repack_cmpdcpl(FNAME0,FNAME0OUT)<=0) + if (h5repack_cmp_pl(FNAME0,FNAME0OUT)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -207,13 +212,13 @@ int main (void) GOERROR; if (h5repack_verify(FNAME1OUT,&pack_options)<=0) GOERROR; - if (h5repack_cmpdcpl(FNAME1,FNAME1OUT)<=0) + if (h5repack_cmp_pl(FNAME1,FNAME1OUT)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - - + + /*------------------------------------------------------------------------- * file with attributes *------------------------------------------------------------------------- @@ -227,12 +232,12 @@ int main (void) GOERROR; if (h5repack_verify(FNAME2OUT,&pack_options)<=0) GOERROR; - if (h5repack_cmpdcpl(FNAME2,FNAME2OUT)<=0) + if (h5repack_cmp_pl(FNAME2,FNAME2OUT)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + /*------------------------------------------------------------------------- * file with hardlinks *------------------------------------------------------------------------- @@ -246,13 +251,13 @@ int main (void) GOERROR; if (h5repack_verify(FNAME3OUT,&pack_options)<=0) GOERROR; - if (h5repack_cmpdcpl(FNAME3,FNAME3OUT)<=0) + if (h5repack_cmp_pl(FNAME3,FNAME3OUT)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); - + /*------------------------------------------------------------------------- * alloc early test *------------------------------------------------------------------------- @@ -269,25 +274,25 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + /*------------------------------------------------------------------------- * the remaining files differ in the dcpl's *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * deflate *------------------------------------------------------------------------- */ TESTING(" adding deflate filter"); - + #ifdef H5_HAVE_FILTER_DEFLATE - + /*------------------------------------------------------------------------- * test an individual object option *------------------------------------------------------------------------- */ - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0) @@ -306,16 +311,16 @@ int main (void) #else SKIPPED(); #endif - + /*------------------------------------------------------------------------- * test all objects option *------------------------------------------------------------------------- */ - + TESTING(" adding deflate filter to all"); - + #ifdef H5_HAVE_FILTER_DEFLATE - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addfilter("GZIP=1",&pack_options) < 0) @@ -330,29 +335,29 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + /*------------------------------------------------------------------------- * SZIP *------------------------------------------------------------------------- */ - + TESTING(" adding szip filter"); - + #if defined (H5_HAVE_FILTER_SZIP) if (h5tools_can_encode(H5Z_FILTER_SZIP) >0) { szip_can_encode = 1; } - + /*------------------------------------------------------------------------- * test an individual object option *------------------------------------------------------------------------- */ - + if (szip_can_encode) { if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -368,7 +373,7 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); } else { SKIPPED(); @@ -376,14 +381,14 @@ int main (void) #else SKIPPED(); #endif - - + + /*------------------------------------------------------------------------- * test all objects option *------------------------------------------------------------------------- */ TESTING(" adding szip filter to all"); - + #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { if (h5repack_init (&pack_options, 0) < 0) @@ -398,7 +403,7 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); } else { SKIPPED(); @@ -406,17 +411,17 @@ int main (void) #else SKIPPED(); #endif - - + + TESTING(" addding shuffle filter"); - + #ifdef H5_HAVE_FILTER_SHUFFLE - + /*------------------------------------------------------------------------- * test an individual object option *------------------------------------------------------------------------- */ - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) @@ -431,21 +436,21 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + /*------------------------------------------------------------------------- * test all objects option *------------------------------------------------------------------------- */ - + TESTING(" addding shuffle filter to all"); - + #ifdef H5_HAVE_FILTER_SHUFFLE - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addfilter("SHUF",&pack_options) < 0) @@ -460,21 +465,21 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + TESTING(" adding checksum filter"); - + #ifdef H5_HAVE_FILTER_FLETCHER32 - + /*------------------------------------------------------------------------- * test an individual object option *------------------------------------------------------------------------- */ - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) @@ -489,22 +494,22 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + /*------------------------------------------------------------------------- * test all objects option *------------------------------------------------------------------------- */ - - + + TESTING(" adding checksum filter to all"); - + #ifdef H5_HAVE_FILTER_FLETCHER32 - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addfilter("FLET",&pack_options) < 0) @@ -519,47 +524,47 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - + + TESTING(" filter queue fletcher, shuffle, deflate, szip"); - + /*------------------------------------------------------------------------- * add some filters *------------------------------------------------------------------------- */ - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addlayout("dset1:CHUNK 20x10",&pack_options) < 0) GOERROR; - + #if defined (H5_HAVE_FILTER_FLETCHER32) if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) GOERROR; #endif - + #ifdef H5_HAVE_FILTER_SHUFFLE if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) GOERROR; #endif - + #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { if (h5repack_addfilter("dset1:SZIP=8,NN",&pack_options) < 0) GOERROR; } #endif - + #ifdef H5_HAVE_FILTER_DEFLATE if (h5repack_addfilter("dset1:GZIP=1",&pack_options) < 0) GOERROR; #endif - + if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) @@ -568,17 +573,17 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); - - + + TESTING(" adding layout chunked"); - + /*------------------------------------------------------------------------- * test an individual object option *------------------------------------------------------------------------- */ - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) @@ -592,13 +597,13 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + /*------------------------------------------------------------------------- * test all objects option *------------------------------------------------------------------------- */ TESTING(" adding layout chunked to all"); - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) @@ -611,11 +616,11 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); - + TESTING(" adding layout contiguous"); - + /*------------------------------------------------------------------------- * test an individual object option *------------------------------------------------------------------------- @@ -632,11 +637,11 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); - + TESTING(" adding layout contiguous to all"); - + /*------------------------------------------------------------------------- * test all objects option *------------------------------------------------------------------------- @@ -653,16 +658,16 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); - + TESTING(" adding layout compact"); - + /*------------------------------------------------------------------------- * test an individual object option *------------------------------------------------------------------------- */ - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addlayout("dset1:COMPA",&pack_options) < 0) @@ -676,14 +681,14 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" adding layout compact to all"); - + /*------------------------------------------------------------------------- * test all objects option *------------------------------------------------------------------------- */ - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addlayout("COMPA",&pack_options) < 0) @@ -696,12 +701,12 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); - - + + TESTING(" layout compact to contiguous conversion"); - + /*------------------------------------------------------------------------- * layout compact to contiguous conversion *------------------------------------------------------------------------- @@ -719,9 +724,9 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" layout compact to chunk conversion"); - + /*------------------------------------------------------------------------- * layout compact to chunk conversion *------------------------------------------------------------------------- @@ -739,9 +744,9 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" layout compact to compact conversion"); - + /*------------------------------------------------------------------------- * layout compact to compact conversion *------------------------------------------------------------------------- @@ -759,7 +764,7 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" layout contiguous to compact conversion"); /*------------------------------------------------------------------------- * layout contiguous to compact conversion @@ -778,7 +783,7 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" layout contiguous to chunk conversion"); /*------------------------------------------------------------------------- * layout contiguous to chunk conversion @@ -797,9 +802,9 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" layout contiguous to contiguous conversion"); - + /*------------------------------------------------------------------------- * layout contiguous to contiguous conversion *------------------------------------------------------------------------- @@ -817,7 +822,7 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" layout chunked to compact conversion"); /*------------------------------------------------------------------------- * layout chunked to compact conversion @@ -836,9 +841,9 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" layout chunked to contiguous conversion"); - + /*------------------------------------------------------------------------- * layout chunked to contiguous conversion *------------------------------------------------------------------------- @@ -856,7 +861,7 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + TESTING(" layout chunked to chunk conversion"); /*------------------------------------------------------------------------- * layout chunked to chunked conversion @@ -875,8 +880,8 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - - + + /*------------------------------------------------------------------------- * the following tests assume the input files have filters * FNAME7 @@ -886,10 +891,10 @@ int main (void) * FNAME11 *------------------------------------------------------------------------- */ - - + + TESTING(" copy of szip filter"); - + #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { if (h5repack_init (&pack_options, 0) < 0) @@ -900,11 +905,11 @@ int main (void) GOERROR; if (h5repack_verify(FNAME7OUT,&pack_options)<=0) GOERROR; - if (h5repack_cmpdcpl(FNAME7,FNAME7OUT)<=0) + if (h5repack_cmp_pl(FNAME7,FNAME7OUT)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); } else { SKIPPED(); @@ -912,9 +917,9 @@ int main (void) #else SKIPPED(); #endif - + TESTING(" removing szip filter"); - + #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { if (h5repack_init (&pack_options, 0) < 0) @@ -929,7 +934,7 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); } else { SKIPPED(); @@ -937,10 +942,10 @@ int main (void) #else SKIPPED(); #endif - - + + TESTING(" copy of deflate filter"); - + #ifdef H5_HAVE_FILTER_DEFLATE if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -952,15 +957,15 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - + + TESTING(" removing deflate filter"); - + #ifdef H5_HAVE_FILTER_DEFLATE if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -974,16 +979,16 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - - + + + TESTING(" copy of shuffle filter"); - + #ifdef H5_HAVE_FILTER_SHUFFLE if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -995,14 +1000,14 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + TESTING(" removing shuffle filter"); - + #ifdef H5_HAVE_FILTER_SHUFFLE if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1016,14 +1021,14 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + TESTING(" copy of fletcher filter"); - + #ifdef H5_HAVE_FILTER_FLETCHER32 if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1035,14 +1040,14 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + TESTING(" removing fletcher filter"); - + #ifdef H5_HAVE_FILTER_FLETCHER32 if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1056,15 +1061,15 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - + + TESTING(" copy of nbit filter"); - + #ifdef H5_HAVE_FILTER_NBIT if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1076,14 +1081,14 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + TESTING(" removing nbit filter"); - + #ifdef H5_HAVE_FILTER_NBIT if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1097,15 +1102,15 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - + + TESTING(" adding nbit filter"); - + #ifdef H5_HAVE_FILTER_NBIT if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1119,15 +1124,15 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - + + TESTING(" copy of scaleoffset filter"); - + #ifdef H5_HAVE_FILTER_SCALEOFFSET if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1139,14 +1144,14 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + TESTING(" removing scaleoffset filter"); - + #ifdef H5_HAVE_FILTER_SCALEOFFSET if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1160,15 +1165,15 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - + + TESTING(" adding scaleoffset filter"); - + #ifdef H5_HAVE_FILTER_SCALEOFFSET if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1182,14 +1187,14 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - - + + + /*------------------------------------------------------------------------- * file with all filters * dset_all @@ -1199,14 +1204,14 @@ int main (void) * dset_fletcher32 *------------------------------------------------------------------------- */ - - + + TESTING(" filter conversion from deflate to szip"); - + #if defined (H5_HAVE_FILTER_SZIP) \ && defined (H5_HAVE_FILTER_DEFLATE) \ && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) - + if (szip_can_encode) { if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1220,7 +1225,7 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); } else { SKIPPED(); @@ -1228,13 +1233,13 @@ int main (void) #else SKIPPED(); #endif - + TESTING(" filter conversion from szip to deflate"); - + #if defined (H5_HAVE_FILTER_SZIP) \ && defined (H5_HAVE_FILTER_DEFLATE) \ && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) - + if (szip_can_encode) { if (h5repack_init (&pack_options, 0) < 0) GOERROR; @@ -1248,7 +1253,7 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); } else { SKIPPED(); @@ -1256,18 +1261,18 @@ int main (void) #else SKIPPED(); #endif - - + + /*------------------------------------------------------------------------- * test the NONE global option *------------------------------------------------------------------------- */ - + TESTING(" removing all filters"); - + #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) \ && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addfilter("NONE",&pack_options) < 0) @@ -1280,12 +1285,12 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - + /*------------------------------------------------------------------------- * test a big file *------------------------------------------------------------------------- @@ -1302,7 +1307,7 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + /*------------------------------------------------------------------------- * test external dataset *------------------------------------------------------------------------- @@ -1319,7 +1324,7 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - + /*------------------------------------------------------------------------- * test file with userblock *------------------------------------------------------------------------- @@ -1338,7 +1343,7 @@ int main (void) if(h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - + /*------------------------------------------------------------------------- * test --latest options *------------------------------------------------------------------------- @@ -1363,17 +1368,17 @@ int main (void) if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - - + + /*------------------------------------------------------------------------- * test several global filters *------------------------------------------------------------------------- */ - + TESTING(" several global filters"); - + #if defined (H5_HAVE_FILTER_DEFLATE) && defined (H5_HAVE_FILTER_SHUFFLE) - + if (h5repack_init (&pack_options, 0) < 0) GOERROR; if (h5repack_addfilter("GZIP=1",&pack_options) < 0) @@ -1388,28 +1393,28 @@ int main (void) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; - + PASSED(); #else SKIPPED(); #endif - - + + /*------------------------------------------------------------------------- * test file with userblock *------------------------------------------------------------------------- */ TESTING(" file with added userblock"); - + #ifdef H5_HAVE_FILTER_DEFLATE - + if(h5repack_init(&pack_options, 0) < 0) GOERROR; - + /* add the options for a user block size and user block filename */ pack_options.ublock_size = USERBLOCK_SIZE; pack_options.ublock_filename = FNAME_UB; - + if(h5repack(FNAME8, FNAME8OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) @@ -1420,44 +1425,44 @@ int main (void) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; - - + + PASSED(); #else SKIPPED(); #endif - - + + /*------------------------------------------------------------------------- * test file with aligment *------------------------------------------------------------------------- */ TESTING(" file with aligment"); - + #ifdef H5_HAVE_FILTER_DEFLATE - + if(h5repack_init(&pack_options, 0) < 0) GOERROR; - + /* add the options for aligment */ pack_options.alignment = 1; pack_options.threshold = 1; - + if(h5repack(FNAME8, FNAME8OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; if(h5repack_verify(FNAME8OUT, &pack_options) <= 0) GOERROR; - - + + /* verify aligment */ { hsize_t threshold; hsize_t alignment; hid_t fapl; hid_t fid; - + if (( fid = H5Fopen(FNAME8OUT, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) GOERROR; if ((fapl = H5Fget_access_plist(fid)) < 0) @@ -1472,264 +1477,297 @@ int main (void) GOERROR; if (H5Fclose(fid) < 0) GOERROR; - + } - - + + if(h5repack_end(&pack_options) < 0) GOERROR; - - + + PASSED(); #else SKIPPED(); #endif - - - - - + + + /*------------------------------------------------------------------------- + * test file with userblock + *------------------------------------------------------------------------- + */ + TESTING(" file with committed datatypes"); + + if(h5repack_init(&pack_options, 0) < 0) + GOERROR; + + if(h5repack(FNAME17, FNAME17OUT, &pack_options) < 0) + GOERROR; + if(h5diff(FNAME17, FNAME17OUT, NULL, NULL, &diff_options) > 0) + GOERROR; + if(h5repack_verify(FNAME17OUT, &pack_options) <= 0) + GOERROR; + if(h5repack_end(&pack_options) < 0) + GOERROR; + + + PASSED(); + + + /*------------------------------------------------------------------------- * clean temporary test files *------------------------------------------------------------------------- */ { hid_t fapl; - + /* setup */ h5_reset(); fapl = h5_fileaccess(); h5_cleanup(H5REPACK_FILENAMES, fapl); - + } - + puts("All h5repack tests passed."); - + return 0; - + error: puts("***** H5REPACK TESTS FAILED *****"); return 1; - + } /*------------------------------------------------------------------------- - * Function: make_testfiles - * - * Purpose: make a test file with all types of HDF5 objects, - * datatypes and filters - * - *------------------------------------------------------------------------- - */ +* Function: make_testfiles +* +* Purpose: make a test file with all types of HDF5 objects, +* datatypes and filters +* +*------------------------------------------------------------------------- +*/ +static int make_testfiles(void) { - hid_t loc_id; - - + hid_t fid; + /*------------------------------------------------------------------------- * create a file for general copy test *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME0,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME0,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_fill(loc_id) < 0) + if (make_fill(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create another file for general copy test (all datatypes) *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_all_objects(loc_id) < 0) + if (make_all_objects(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file for attributes copy test *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_attributes(loc_id) < 0) + if (make_attributes(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file for hard links test *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_hlinks(loc_id) < 0) + if (make_hlinks(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file for layouts test *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_layout(loc_id) < 0) + if (make_layout(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file for the H5D_ALLOC_TIME_EARLY test *------------------------------------------------------------------------- */ if (make_early() < 0) goto out; - + /*------------------------------------------------------------------------- * create a file with the SZIP filter *------------------------------------------------------------------------- */ #ifdef H5_HAVE_FILTER_SZIP - if((loc_id = H5Fcreate(FNAME7,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME7,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_szip(loc_id) < 0) + if (make_szip(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; #endif /* H5_HAVE_FILTER_SZIP */ - - + + /*------------------------------------------------------------------------- * create a file with the deflate filter *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME8,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME8,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_deflate(loc_id) < 0) + if (make_deflate(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file with the shuffle filter *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME9,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME9,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_shuffle(loc_id) < 0) + if (make_shuffle(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file with the fletcher32 filter *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME10,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME10,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_fletcher32(loc_id) < 0) + if (make_fletcher32(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file with all the filters *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME11,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME11,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_all(loc_id) < 0) + if (make_all_filters(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file with the nbit filter *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME12,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME12,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_nbit(loc_id) < 0) + if (make_nbit(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file with the scaleoffset filter *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME13,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME13,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_scaleoffset(loc_id) < 0) + if (make_scaleoffset(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a big dataset *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME14,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME14,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_big(loc_id) < 0) + if (make_big(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file with external dataset *------------------------------------------------------------------------- */ - if((loc_id = H5Fcreate(FNAME15,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME15,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) return -1; - if (make_external(loc_id) < 0) + if (make_external(fid) < 0) goto out; - if(H5Fclose(loc_id) < 0) + if(H5Fclose(fid) < 0) return -1; - + /*------------------------------------------------------------------------- * create a file with userblock *------------------------------------------------------------------------- */ if(make_userblock() < 0) goto out; - + /*------------------------------------------------------------------------- * create a userblock file *------------------------------------------------------------------------- */ if(make_userblock_file() < 0) goto out; - + + /*------------------------------------------------------------------------- + * create a file with named datatypes + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME17,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + return -1; + if (make_named_dtype(fid) < 0) + goto out; + if(H5Fclose(fid) < 0) + return -1; + return 0; - + out: - H5Fclose(loc_id); + H5Fclose(fid); return -1; } /*------------------------------------------------------------------------- - * Function: make_all_objects - * - * Purpose: make a test file with all types of HDF5 objects - * - *------------------------------------------------------------------------- - */ +* Function: make_all_objects +* +* Purpose: make a test file with all types of HDF5 objects +* +*------------------------------------------------------------------------- +*/ +static int make_all_objects(hid_t loc_id) { - hid_t dset_id; - hid_t group_id; - hid_t type_id; - hid_t root_id; - hid_t space_id; + hid_t did=-1; + hid_t gid=-1; + hid_t tid=-1; + hid_t rid=-1; + hid_t sid=-1; + hid_t gcplid=-1; hsize_t dims[1]={2}; - /* Compound datatype */ + /* compound datatype */ typedef struct s_t { int a; @@ -1737,124 +1775,186 @@ int make_all_objects(hid_t loc_id) } s_t; /*------------------------------------------------------------------------- - * H5G_DATASET - *------------------------------------------------------------------------- - */ - space_id = H5Screate_simple(1, dims, NULL); - dset_id = H5Dcreate2(loc_id, "dset_referenced", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Sclose(space_id); - - /*------------------------------------------------------------------------- - * H5G_GROUP - *------------------------------------------------------------------------- - */ - group_id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - root_id = H5Gopen2(loc_id, "/", H5P_DEFAULT); + * H5G_DATASET + *------------------------------------------------------------------------- + */ + if ((sid = H5Screate_simple(1, dims, NULL)) < 0) + goto out; + if ((did = H5Dcreate2(loc_id, "dset_referenced", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + /*------------------------------------------------------------------------- - * H5G_TYPE - *------------------------------------------------------------------------- - */ - - /* Create a memory compound datatype */ - type_id = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_INT); - H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_FLOAT); + * H5G_GROUP + *------------------------------------------------------------------------- + */ + if ((gid = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if (H5Gclose(gid) < 0) + goto out; - /* Commit compound datatype and close it */ - H5Tcommit2(loc_id, "type", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Tclose(type_id); + /* create a group "g2" with H5P_CRT_ORDER_TRACKED set */ + if ((gcplid = H5Pcreate(H5P_GROUP_CREATE)) < 0) + goto out; + if (H5Pset_link_creation_order(gcplid, H5P_CRT_ORDER_TRACKED) < 0) + goto out; + if ((gid = H5Gcreate2(loc_id, "g2", H5P_DEFAULT, gcplid, H5P_DEFAULT)) < 0) + goto out; + if (H5Gclose(gid) < 0) + goto out; /*------------------------------------------------------------------------- - * H5G_LINK - *------------------------------------------------------------------------- - */ + * H5G_TYPE + *------------------------------------------------------------------------- + */ + + /* create a compound datatype */ + if ((tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) < 0) + goto out; + if (H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_INT) < 0) + goto out; + if (H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_FLOAT) < 0) + goto out; + if (H5Tcommit2(loc_id, "type", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5G_LINK + *------------------------------------------------------------------------- + */ - H5Lcreate_soft("dset", loc_id, "link", H5P_DEFAULT, H5P_DEFAULT); + if (H5Lcreate_soft("dset", loc_id, "link", H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; /*------------------------------------------------------------------------- - * H5G_UDLINK - *------------------------------------------------------------------------- - */ + * H5G_UDLINK + *------------------------------------------------------------------------- + */ /* Create an external link. Other UD links are not supported by h5repack */ - H5Lcreate_external("file", "path", loc_id, "ext_link", H5P_DEFAULT, H5P_DEFAULT); + if (H5Lcreate_external("file", "path", loc_id, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; /*------------------------------------------------------------------------- - * write a series of datasetes - *------------------------------------------------------------------------- - */ + * write a series of datasetes at root + *------------------------------------------------------------------------- + */ - write_dset_in(root_id,"dset_referenced",loc_id,0); + if ((rid = H5Gopen2(loc_id, "/", H5P_DEFAULT)) < 0) + goto out; + if (write_dset_in(rid,"dset_referenced",loc_id,0) < 0) + goto out; + if (H5Gclose(rid) < 0) + goto out; - /* Close */ - H5Dclose(dset_id); - H5Gclose(group_id); - H5Gclose(root_id); + /* close */ + if (H5Dclose(did) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + if (H5Pclose(gcplid) < 0) + goto out; return 0; + +out: + H5E_BEGIN_TRY + { + H5Dclose(did); + H5Gclose(gid); + H5Gclose(rid); + H5Sclose(sid); + H5Tclose(tid); + H5Pclose(gcplid); + } H5E_END_TRY; + return -1; } /*------------------------------------------------------------------------- - * Function: make_attributes - * - * Purpose: make a test file with all types of attributes - * - *------------------------------------------------------------------------- - */ +* Function: make_attributes +* +* Purpose: make a test file with all types of attributes +* +*------------------------------------------------------------------------- +*/ +static int make_attributes(hid_t loc_id) { - hid_t dset_id; - hid_t group_id; - hid_t root_id; - hid_t space_id; + hid_t did=-1; + hid_t gid=-1; + hid_t rid=-1; + hid_t sid=-1; hsize_t dims[1]={2}; /*------------------------------------------------------------------------- * H5G_DATASET *------------------------------------------------------------------------- */ - - space_id = H5Screate_simple(1, dims, NULL); - dset_id = H5Dcreate2(loc_id, "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Sclose(space_id); + if ((sid = H5Screate_simple(1, dims, NULL)) < 0) + goto out; + if ((did = H5Dcreate2(loc_id, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; /*------------------------------------------------------------------------- * H5G_GROUP *------------------------------------------------------------------------- */ - group_id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - root_id = H5Gopen2(loc_id, "/", H5P_DEFAULT); + if ((gid = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if ((rid = H5Gopen2(loc_id, "/", H5P_DEFAULT)) < 0) + goto out; /*------------------------------------------------------------------------- * write a series of attributes on the dataset, group, and root group *------------------------------------------------------------------------- */ - write_attr_in(dset_id,"dset",loc_id,0); - write_attr_in(group_id,"dset",loc_id,0); - write_attr_in(root_id,"dset",loc_id,0); - - /* Close */ - H5Dclose(dset_id); - H5Gclose(group_id); - H5Gclose(root_id); + if ( write_attr_in(did,"dset",loc_id,0) < 0) + goto out; + if (write_attr_in(gid,"dset",loc_id,0) < 0) + goto out; + if (write_attr_in(rid,"dset",loc_id,0) < 0) + goto out; + /* close */ + if (H5Dclose(did) < 0) + goto out; + if (H5Gclose(gid) < 0) + goto out; + if (H5Gclose(rid) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + return 0; + +out: + H5E_BEGIN_TRY + { + H5Dclose(did); + H5Gclose(gid); + H5Gclose(rid); + H5Sclose(sid); + } H5E_END_TRY; + return -1; + } /*------------------------------------------------------------------------- - * Function: make_hlinks - * - * Purpose: make a test file with hard links - * - *------------------------------------------------------------------------- - */ +* Function: make_hlinks +* +* Purpose: make a test file with hard links +* +*------------------------------------------------------------------------- +*/ +static int make_hlinks(hid_t loc_id) { - hid_t group1_id; - hid_t group2_id; - hid_t group3_id; + hid_t g1id=-1; + hid_t g2id=-1; + hid_t g3id=-1; hsize_t dims[2]={3,2}; int buf[3][2]= {{1,1},{1,2},{2,2}}; @@ -1872,40 +1972,55 @@ int make_hlinks(hid_t loc_id) if(H5Lcreate_hard(loc_id, "dset", H5L_SAME_LOC, "link3 to dset", H5P_DEFAULT, H5P_DEFAULT) < 0) return -1; - /*------------------------------------------------------------------------- * create a group and some hard links to it *------------------------------------------------------------------------- */ - if((group1_id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - return -1; - if((group2_id = H5Gcreate2(group1_id, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - return -1; - if((group3_id = H5Gcreate2(group2_id, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - return -1; + if((g1id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if((g2id = H5Gcreate2(g1id, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if((g3id = H5Gcreate2(g2id, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; - if(H5Lcreate_hard(loc_id, "g1", group2_id, "link1 to g1", H5P_DEFAULT, H5P_DEFAULT) < 0) - return -1; - if(H5Lcreate_hard(group1_id, "g2", group3_id, "link1 to g2", H5P_DEFAULT, H5P_DEFAULT) < 0) - return -1; + if(H5Lcreate_hard(loc_id, "g1", g2id, "link1 to g1", H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; + if(H5Lcreate_hard(g1id, "g2", g3id, "link1 to g2", H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; - H5Gclose(group1_id); - H5Gclose(group2_id); - H5Gclose(group3_id); + /* close */ + if (H5Gclose(g1id) < 0) + goto out; + if (H5Gclose(g2id) < 0) + goto out; + if (H5Gclose(g3id) < 0) + goto out; + return 0; + +out: + H5E_BEGIN_TRY + { + H5Gclose(g1id); + H5Gclose(g2id); + H5Gclose(g3id); + } H5E_END_TRY; + return -1; + } /*------------------------------------------------------------------------- - * Function: make_szip - * - * Purpose: make a dataset with the SZIP filter - * - *------------------------------------------------------------------------- - */ +* Function: make_szip +* +* Purpose: make a dataset with the SZIP filter +* +*------------------------------------------------------------------------- +*/ #ifdef H5_HAVE_FILTER_SZIP +static int make_szip(hid_t loc_id) { hid_t dcpl; /* dataset creation property list */ @@ -1916,8 +2031,8 @@ int make_szip(hid_t loc_id) hsize_t chunk_dims[RANK]={CDIM1,CDIM2}; int buf[DIM1][DIM2]; int i, j, n; - int szip_can_encode = 0; - + int szip_can_encode = 0; + for (i=n=0; i= 0); - status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf5); - assert(status >= 0); - status = H5Dclose(dset_id); - status = H5Tclose(type_id); - status = H5Sclose(space_id); - + + if ((sid = H5Screate_simple(1, dims, NULL)) < 0) + goto out; + if ((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) + goto out; + if ((did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5) < 0) + goto out; + if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5) < 0) + goto out; + if (H5Dclose(did) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -3333,28 +3499,28 @@ void write_dset_in(hid_t loc_id, buf6[i][j]=0; } } - - type_id = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_dset(loc_id, 1, dims, "array", type_id, buf6); - status = H5Tclose(type_id); + + if ((tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray)) < 0) + goto out; + if (write_dset(loc_id, 1, dims, "array", tid, buf6) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; { - double *dbuf; /* information to write */ - hid_t did; /* dataset ID */ - hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ - size_t size; - hsize_t sdims[] = {1}; - hsize_t tdims[] = {H5TOOLS_MALLOCSIZE / sizeof(double) + 1}; - int j; + double *dbuf; /* information to write */ + size_t size; + hsize_t sdims[] = {1}; + hsize_t tdims[] = {H5TOOLS_MALLOCSIZE / sizeof(double) + 1}; + unsigned u; /* allocate and initialize array data to write */ size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double); - dbuf = malloc( size ); + dbuf = (double*)malloc( size ); - for( j = 0; j < H5TOOLS_MALLOCSIZE / sizeof(double) + 1; j++) - dbuf[j] = j; + for( u = 0; u < H5TOOLS_MALLOCSIZE / sizeof(double) + 1; u++) + dbuf[u] = u; if (make_diffs) { @@ -3363,10 +3529,13 @@ void write_dset_in(hid_t loc_id, } /* create a type larger than H5TOOLS_MALLOCSIZE */ - tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims); + if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0) + goto out; size = H5Tget_size(tid); - sid = H5Screate_simple(1, sdims, NULL); - did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if ((sid = H5Screate_simple(1, sdims, NULL)) < 0) + goto out; + if ((did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; #if defined(WRITE_ARRAY) H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); #endif @@ -3377,12 +3546,12 @@ void write_dset_in(hid_t loc_id, H5Sclose(sid); free( dbuf ); } - + /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -3391,72 +3560,90 @@ void write_dset_in(hid_t loc_id, buf8[i]=0; } } - - write_dset(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); - write_dset(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); - - + + if (write_dset(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7) < 0) + goto out; + if (write_dset(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8) < 0) + goto out; + + /*------------------------------------------------------------------------- * 2D *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf12, 'z', sizeof buf12); } - - - type_id = H5Tcopy(H5T_C_S1); - status = H5Tset_size(type_id, (size_t)2); - write_dset(loc_id,2,dims2,"string2D",type_id,buf12); - status = H5Tclose(type_id); - + + + if ((tid = H5Tcopy(H5T_C_S1)) < 0) + goto out; + if (H5Tset_size(tid, (size_t)2) < 0) + goto out; + if (write_dset(loc_id,2,dims2,"string2D",tid,buf12) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - - + + if (make_diffs) { memset(buf22,0,sizeof buf22); } - - type_id = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,2,dims2,"bitfield2D",type_id,buf22); - status = H5Tclose(type_id); - + + if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0) + goto out; + if (write_dset(loc_id,2,dims2,"bitfield2D",tid,buf22) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - type_id = H5Tcreate(H5T_OPAQUE, (size_t)1); - status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,2,dims2,"opaque2D",type_id,buf22); - status = H5Tclose(type_id); - + if ((tid = H5Tcreate(H5T_OPAQUE, (size_t)1)) < 0) + goto out; + if (H5Tset_tag(tid, "1-byte opaque type") < 0) + goto out; + if (write_dset(loc_id,2,dims2,"opaque2D",tid,buf22) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf32,0,sizeof buf32); } - - type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,2,dims2,"compound2D",type_id,buf32); - status = H5Tclose(type_id); - + + if ((tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t))) < 0) + goto out; + if (H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR) < 0) + goto out; + if (H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE) < 0) + goto out; + if (write_dset(loc_id,2,dims2,"compound2D",tid,buf32) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -3464,373 +3651,478 @@ void write_dset_in(hid_t loc_id, /* Create references to dataset */ if (dset_name) { - status = H5Rcreate(&buf42[0][0], file_id, dset_name, H5R_OBJECT, -1); - write_dset(loc_id, 2, dims2r, "refobj2D", H5T_STD_REF_OBJ, buf42); + if (H5Rcreate(&buf42[0][0], file_id, dset_name, H5R_OBJECT, -1) < 0) + goto out; + if (write_dset(loc_id, 2, dims2r, "refobj2D", H5T_STD_REF_OBJ, buf42) < 0) + goto out; } - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ - - type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(type_id, "RED", (val = 0, &val)); - H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); - write_dset(loc_id,2,dims2,"enum2D",type_id,0); - status = H5Tclose(type_id); - + + if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) + goto out; + if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + goto out; + if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + goto out; + if (write_dset(loc_id,2,dims2,"enum2D",tid,0) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n = 0; for(i = 0; i < 3; i++) - for(j = 0; j < 2; j++) { + { + for(j = 0; j < 2; j++) + { int l; - + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = i + 1; for(l = 0; l < i + 1; l++) + { if(make_diffs) ((int *)buf52[i][j].p)[l] = 0; else ((int *)buf52[i][j].p)[l] = n++; - } - - space_id = H5Screate_simple(2, dims2, NULL); - type_id = H5Tvlen_create(H5T_NATIVE_INT); - dset_id = H5Dcreate2(loc_id, "vlen2D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); - assert(status >= 0); - status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf52); - assert(status >= 0); - status = H5Dclose(dset_id); - status = H5Tclose(type_id); - status = H5Sclose(space_id); - - /*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - - if (make_diffs) - { - memset(buf62,0,sizeof buf62); - } - - - type_id = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_dset(loc_id, 2, dims2, "array2D", type_id, buf62); - status = H5Tclose(type_id); - - /*------------------------------------------------------------------------- - * H5T_INTEGER, write a fill value - *------------------------------------------------------------------------- - */ - - - if(make_diffs) { - memset(buf72, 0, sizeof buf72); - memset(buf82, 0, sizeof buf82); - } - - - plist_id = H5Pcreate(H5P_DATASET_CREATE); - space_id = H5Screate_simple(2, dims2, NULL); - dset_id = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT); - status = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72); - status = H5Pclose(plist_id); - status = H5Dclose(dset_id); - status = H5Sclose(space_id); - - /*------------------------------------------------------------------------- - * H5T_FLOAT - *------------------------------------------------------------------------- - */ - - write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - - - /*------------------------------------------------------------------------- - * 3D - *------------------------------------------------------------------------- - */ - - /*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ - - if (make_diffs) - { - memset(buf13,'z',sizeof buf13); - } - - type_id = H5Tcopy(H5T_C_S1); - status = H5Tset_size(type_id, (size_t)2); - write_dset(loc_id,3,dims3,"string3D",type_id,buf13); - status = H5Tclose(type_id); - - /*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ - - - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { - if (make_diffs) buf23[i][j][k]=0; - else buf23[i][j][k]=n++; - } - } - } - - - type_id = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,3,dims3,"bitfield3D",type_id,buf23); - status = H5Tclose(type_id); - - /*------------------------------------------------------------------------- - * H5T_OPAQUE - *------------------------------------------------------------------------- - */ - type_id = H5Tcreate(H5T_OPAQUE, (size_t)1); - status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,3,dims3,"opaque3D",type_id,buf23); - status = H5Tclose(type_id); - - /*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ - - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { - if (make_diffs) { - buf33[i][j][k].a=0; - buf33[i][j][k].b=0; - } - else { - buf33[i][j][k].a=n++; - buf33[i][j][k].b=n++; - } - } } } - - - type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,3,dims3,"compound3D",type_id,buf33); - status = H5Tclose(type_id); - - /*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - /* Create references to dataset */ - if (dset_name) - { - status = H5Rcreate(&buf43[0][0][0], file_id, dset_name, H5R_OBJECT, -1); - write_dset(loc_id, 3, dims3r, "refobj3D", H5T_STD_REF_OBJ, buf43); - } - - /*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ - - type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(type_id, "RED", (val = 0, &val)); - H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); - write_dset(loc_id,3,dims3,"enum3D",type_id,0); - status = H5Tclose(type_id); - - /*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ - - /* Allocate and initialize VL dataset to write */ - n = 0; - for(i = 0; i < 4; i++) - for(j = 0; j < 3; j++) - for(k = 0; k < 2; k++) { - int l; - - buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; - for(l = 0; l < i + 1; l++) - if(make_diffs) - ((int *)buf53[i][j][k].p)[l] = 0; - else - ((int *)buf53[i][j][k].p)[l] = n++; - } - - space_id = H5Screate_simple(3, dims3, NULL); - type_id = H5Tvlen_create(H5T_NATIVE_INT); - dset_id = H5Dcreate2(loc_id, "vlen3D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); - assert(status >= 0); - status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf53); - assert(status >= 0); - status = H5Dclose(dset_id); - status = H5Tclose(type_id); - status = H5Sclose(space_id); - - /*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - - - n = 1; - for(i = 0; i < 24; i++) - for(j = 0; j < (int)dimarray[0]; j++) - if(make_diffs) - buf63[i][j] = 0; - else - buf63[i][j] = n++; - - type_id = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_dset(loc_id, 3, dims3, "array3D", type_id, buf63); - status = H5Tclose(type_id); - - /*------------------------------------------------------------------------- - * H5T_INTEGER and H5T_FLOAT - *------------------------------------------------------------------------- - */ - n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { - if (make_diffs) { - buf73[i][j][k]=0; - buf83[i][j][k]=0; - } - else { - buf73[i][j][k]=n++; - buf83[i][j][k]=f++; - } - } - } - } - write_dset(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); - write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); -} + } + if ((sid = H5Screate_simple(2, dims2, NULL)) < 0) + goto out; + if ((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) + goto out; + if ((did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52) < 0) + goto out; + if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52) < 0) + goto out; + if (H5Dclose(did) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * Function: make_dset_reg_ref - * - * Purpose: write dataset region references - * - *------------------------------------------------------------------------- - */ + if (make_diffs) + { + memset(buf62,0,sizeof buf62); + } -#define SPACE1_RANK 1 -#define SPACE1_DIM1 1 -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 -#define NPOINTS 10 -void make_dset_reg_ref(hid_t loc_id) -{ - hid_t dset1; /* Dataset ID */ - hid_t dset2; /* Dereferenced dataset ID */ - hid_t sid1; /* Dataspace ID #1 */ - hid_t sid2; /* Dataspace ID #2 */ + if ((tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray)) < 0) + goto out; + if (write_dset(loc_id, 2, dims2, "array2D", tid, buf62) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_INTEGER, write a fill value + *------------------------------------------------------------------------- + */ + + + if(make_diffs) { + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); + } + + + if ((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto out; + if ((sid = H5Screate_simple(2, dims2, NULL)) < 0) + goto out; + if ((did = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) + goto out; + if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72) < 0) + goto out; + if (H5Pclose(pid) < 0) + goto out; + if (H5Dclose(did) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_FLOAT + *------------------------------------------------------------------------- + */ + + if (write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82) < 0) + goto out; + + + /*------------------------------------------------------------------------- + * 3D + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf13,'z',sizeof buf13); + } + + if ((tid = H5Tcopy(H5T_C_S1)) < 0) + goto out; + if (H5Tset_size(tid, (size_t)2) < 0) + goto out; + if (write_dset(loc_id,3,dims3,"string3D",tid,buf13) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + + n=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) buf23[i][j][k]=0; + else buf23[i][j][k]=n++; + } + } + } + + + if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0) + goto out; + if (write_dset(loc_id,3,dims3,"bitfield3D",tid,buf23) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + if ((tid = H5Tcreate(H5T_OPAQUE, (size_t)1)) < 0) + goto out; + if (H5Tset_tag(tid, "1-byte opaque type") < 0) + goto out; + if (write_dset(loc_id,3,dims3,"opaque3D",tid,buf23) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + n=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf33[i][j][k].a=0; + buf33[i][j][k].b=0; + } + else { + buf33[i][j][k].a=n++; + buf33[i][j][k].b=n++; + } + } + } + } + + + if ((tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t))) < 0) + goto out; + if (H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR) < 0) + goto out; + if (H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE) < 0) + goto out; + if (write_dset(loc_id,3,dims3,"compound3D",tid,buf33) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) + { + if (H5Rcreate(&buf43[0][0][0], file_id, dset_name, H5R_OBJECT, -1) < 0) + goto out; + if (write_dset(loc_id, 3, dims3r, "refobj3D", H5T_STD_REF_OBJ, buf43) < 0) + goto out; + } + + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + + if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) + goto out; + if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + goto out; + if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + goto out; + if (write_dset(loc_id,3,dims3,"enum3D",tid,0) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n = 0; + for(i = 0; i < 4; i++) + { + for(j = 0; j < 3; j++) + { + for(k = 0; k < 2; k++) + { + int l; + + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); + buf53[i][j][k].len = i + 1; + for(l = 0; l < i + 1; l++) + { + if(make_diffs) + ((int *)buf53[i][j][k].p)[l] = 0; + else + ((int *)buf53[i][j][k].p)[l] = n++; + } + } + } + } + + if ((sid = H5Screate_simple(3, dims3, NULL)) < 0) + goto out; + if ((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) + goto out; + if ((did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53) < 0) + goto out; + + if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53) < 0) + goto out; + + if (H5Dclose(did) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + + n = 1; + for(i = 0; i < 24; i++) + { + for(j = 0; j < (int)dimarray[0]; j++) + { + if(make_diffs) + buf63[i][j] = 0; + else + buf63[i][j] = n++; + } + } + + if ((tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray)) < 0) + goto out; + if (write_dset(loc_id, 3, dims3, "array3D", tid, buf63) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + n=1; f=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf73[i][j][k]=0; + buf83[i][j][k]=0; + } + else { + buf73[i][j][k]=n++; + buf83[i][j][k]=f++; + } + } + } + } + if (write_dset(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73) < 0) + goto out; + if (write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83) < 0) + goto out; + + + return 0; + + +out: + H5E_BEGIN_TRY + { + H5Pclose(pid); + H5Sclose(sid); + H5Dclose(did); + H5Tclose(tid); + } H5E_END_TRY; + return -1; +} + + + +/*------------------------------------------------------------------------- +* Function: make_dset_reg_ref +* +* Purpose: write dataset region references +* +*------------------------------------------------------------------------- +*/ + +#define SPACE1_RANK 1 +#define SPACE1_DIM1 1 +#define SPACE2_RANK 2 +#define SPACE2_DIM1 10 +#define SPACE2_DIM2 10 +static +int make_dset_reg_ref(hid_t loc_id) +{ + hid_t did1=-1; /* Dataset ID */ + hid_t did2=-1; /* Dereferenced dataset ID */ + hid_t sid1=-1; /* Dataspace ID #1 */ + hid_t sid2=-1; /* Dataspace ID #2 */ hsize_t dims1[] = {SPACE1_DIM1}; hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hdset_reg_ref_t *wbuf; /* buffer to write to disk */ - int *dwbuf; /* Buffer for writing numeric data to disk */ + hdset_reg_ref_t *wbuf=NULL; /* buffer to write to disk */ + int *dwbuf=NULL; /* Buffer for writing numeric data to disk */ int i; /* counting variables */ - herr_t ret; /* Generic return value */ - + /* Allocate write & read buffers */ wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2); - + /* Create dataspace for datasets */ - sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL); - + if ((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0) + goto out; + /* Create a dataset */ - dset2 = H5Dcreate2(loc_id, "dsetreg", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - for(i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++) + if ((did2 = H5Dcreate2(loc_id, "dsetreg", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + + for (i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++) dwbuf[i] = i * 3; - + /* Write selection to disk */ - ret = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); - assert(ret >= 0); - - /* Close Dataset */ - ret = H5Dclose(dset2); - assert(ret >= 0); - + if (H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf) < 0) + goto out; + /* Create dataspace for the reference dataset */ - sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); - + if ((sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL)) < 0) + goto out; + /* Create a dataset */ - dset1 = H5Dcreate2(loc_id, "refreg", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* Create references */ - + if ((did1 = H5Dcreate2(loc_id, "refreg", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + /* Select 6x6 hyperslab for first reference */ start[0] = 2; start[1] = 2; stride[0] = 1; stride[1] = 1; count[0] = 6; count[1] = 6; block[0] = 1; block[1] = 1; - ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block); - assert(ret >= 0); - + if (H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block) < 0) + goto out; + + /* Store dataset region */ - ret = H5Rcreate(&wbuf[0], loc_id, "dsetreg", H5R_DATASET_REGION, sid2); - assert(ret >= 0); - + if (H5Rcreate(&wbuf[0], loc_id, "dsetreg", H5R_DATASET_REGION, sid2) < 0) + goto out; + /* Write selection to disk */ - ret=H5Dwrite(dset1,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); - assert(ret >= 0); - + if (H5Dwrite(did1,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf) < 0) + goto out; + /* Close all objects */ - ret = H5Sclose(sid1); - assert(ret >= 0); - ret = H5Dclose(dset1); - assert(ret >= 0); - ret = H5Sclose(sid2); - assert(ret >= 0); - - free(wbuf); - free(dwbuf); + if (H5Sclose(sid1) < 0) + goto out; + if (H5Dclose(did1) < 0) + goto out; + if (H5Sclose(sid2) < 0) + goto out; + if (H5Dclose(did2) < 0) + goto out; + + if (wbuf) + free(wbuf); + if (dwbuf) + free(dwbuf); + + return 0; + +out: + H5E_BEGIN_TRY + { + + H5Sclose(sid1); + H5Sclose(sid2); + H5Dclose(did1); + H5Dclose(did2); + + } H5E_END_TRY; + return -1; } /*------------------------------------------------------------------------- - * Function: write_attr_in - * - * Purpose: write attributes in LOC_ID (dataset, group, named datatype) - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 12, 2003 - * - *------------------------------------------------------------------------- - */ - - -void write_attr_in(hid_t loc_id, +* Function: write_attr_in +* +* Purpose: write attributes in LOC_ID (dataset, group, named datatype) +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 12, 2003 +* +*------------------------------------------------------------------------- +*/ + +static +int write_attr_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t fid, /* for reference create */ int make_diffs /* flag to modify data buffers */) @@ -3841,20 +4133,19 @@ void write_attr_in(hid_t loc_id, char a; double b; } s_t; - + typedef enum { RED, - GREEN + GREEN } e_t; - - hid_t attr_id; - hid_t space_id; - hid_t type_id; - herr_t status; + + hid_t aid; + hid_t sid; + hid_t tid; int val, i, j, k, n; float f; - + /* create 1D attributes with dimension [2], 2 elements */ hsize_t dims[1]={2}; char buf1[2][2]= {"ab","de"}; /* string */ @@ -3867,7 +4158,7 @@ void write_attr_in(hid_t loc_id, int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ int buf7[2]= {1,2}; /* integer */ float buf8[2]= {1,2}; /* float */ - + /* create 2D attributes with dimension [3][2], 6 elements */ hsize_t dims2[2]={3,2}; char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */ @@ -3879,7 +4170,7 @@ void write_attr_in(hid_t loc_id, int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ - + /* create 3D attributes with dimension [4][3][2], 24 elements */ hsize_t dims3[3]={4,3,2}; char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", @@ -3893,18 +4184,18 @@ void write_attr_in(hid_t loc_id, int buf63[24][3]; /* array */ int buf73[4][3][2]; /* integer */ float buf83[4][3][2]; /* float */ - - + + /*------------------------------------------------------------------------- * 1D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -3925,16 +4216,20 @@ void write_attr_in(hid_t loc_id, [ 1 ] d z [ 1 ] e z */ - type_id = H5Tcopy(H5T_C_S1); - status = H5Tset_size(type_id, (size_t)2); - make_attr(loc_id,1,dims,"string",type_id,buf1); - status = H5Tclose(type_id); + if ((tid = H5Tcopy(H5T_C_S1)) < 0) + goto out; + if (H5Tset_size(tid, (size_t)2) < 0) + goto out; + if (make_attr(loc_id,1,dims,"string",tid,buf1) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -3952,15 +4247,18 @@ void write_attr_in(hid_t loc_id, [ 1 ] 2 0 2 */ - type_id = H5Tcopy(H5T_STD_B8LE); - make_attr(loc_id,1,dims,"bitfield",type_id,buf2); - status = H5Tclose(type_id); - + if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0) + goto out; + if (make_attr(loc_id,1,dims,"bitfield",tid,buf2) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - + /* buf2[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -3972,17 +4270,21 @@ void write_attr_in(hid_t loc_id, [ 0 ] 1 0 1 [ 1 ] 2 0 2 */ - - type_id = H5Tcreate(H5T_OPAQUE, (size_t)1); - status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ - make_attr(loc_id,1,dims,"opaque",type_id,buf2); - status = H5Tclose(type_id); - + + if ((tid = H5Tcreate(H5T_OPAQUE, (size_t)1)) < 0) + goto out; + if (H5Tset_tag(tid, "1-byte opaque type") < 0) + goto out; + if (make_attr(loc_id,1,dims,"opaque",tid,buf2) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -3990,7 +4292,7 @@ void write_attr_in(hid_t loc_id, buf3[i].a=0; buf3[i].b=0; } } - + /* buf3[2]= {{1,2},{3,4}}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -4003,13 +4305,18 @@ void write_attr_in(hid_t loc_id, [ 1 ] 3 5 2 [ 1 ] 4 5 1 */ - - type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - make_attr(loc_id,1,dims,"compound",type_id,buf3); - status = H5Tclose(type_id); - + + if ((tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t))) < 0) + goto out; + if (H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR) < 0) + goto out; + if (H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE) < 0) + goto out; + if (make_attr(loc_id,1,dims,"compound",tid,buf3) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -4017,12 +4324,15 @@ void write_attr_in(hid_t loc_id, /* object references ( H5R_OBJECT */ if (dset_name) { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); - make_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + if (H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1) < 0) + goto out; + if (H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1) < 0) + goto out; + if (make_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4) < 0) + goto out; } - - + + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- @@ -4044,19 +4354,24 @@ void write_attr_in(hid_t loc_id, [ 0 ] RED GREEN [ 1 ] RED GREEN */ - type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(type_id, "RED", (val = 0, &val)); - H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); - make_attr(loc_id,1,dims,"enum",type_id,buf45); - status = H5Tclose(type_id); + if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) + goto out; + if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + goto out; + if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + goto out; + if (make_attr(loc_id,1,dims,"enum",tid,buf45) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ - + buf5[0].len = 1; buf5[0].p = malloc( 1 * sizeof(int)); ((int *)buf5[0].p)[0]=1; @@ -4064,7 +4379,7 @@ void write_attr_in(hid_t loc_id, buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; - + if(make_diffs) { ((int *)buf5[0].p)[0] = 0; @@ -4080,23 +4395,29 @@ void write_attr_in(hid_t loc_id, [ 1 ] 2 0 2 [ 1 ] 3 0 3 */ - - space_id = H5Screate_simple(1, dims, NULL); - type_id = H5Tvlen_create(H5T_NATIVE_INT); - attr_id = H5Acreate2(loc_id, "vlen", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); - status = H5Awrite(attr_id, type_id, buf5); - assert(status >= 0); - status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf5); - assert(status >= 0); - status = H5Aclose(attr_id); - status = H5Tclose(type_id); - status = H5Sclose(space_id); - + + if ((sid = H5Screate_simple(1, dims, NULL)) < 0) + goto out; + if ((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) + goto out; + if ((aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if (H5Awrite(aid, tid, buf5) < 0) + goto out; + if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5) < 0) + goto out; + if (H5Aclose(aid) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -4119,15 +4440,18 @@ void write_attr_in(hid_t loc_id, [ 1 ] 5 0 5 [ 1 ] 6 0 6 */ - type_id = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - make_attr(loc_id, 1, dims, "array", type_id, buf6); - status = H5Tclose(type_id); + if ((tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray)) < 0) + goto out; + if (make_attr(loc_id, 1, dims, "array", tid, buf6) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - + if(make_diffs) { for(i = 0; i < 2; i++) @@ -4136,7 +4460,7 @@ void write_attr_in(hid_t loc_id, buf8[i]=0; } } - + /* buf7[2]= {1,2}; buf8[2]= {1,2}; @@ -4151,15 +4475,17 @@ void write_attr_in(hid_t loc_id, [ 0 ] 1 0 1 [ 1 ] 2 0 2 */ - make_attr(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); - make_attr(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); + if (make_attr(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7) < 0) + goto out; + if (make_attr(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8) < 0) + goto out; + - /*------------------------------------------------------------------------- * 2D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -4168,7 +4494,7 @@ void write_attr_in(hid_t loc_id, { memset(buf12, 'z', sizeof buf12); } - + /* buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -4188,22 +4514,26 @@ void write_attr_in(hid_t loc_id, [ 2 1 ] k z [ 2 1 ] l z */ - - type_id = H5Tcopy(H5T_C_S1); - status = H5Tset_size(type_id, (size_t)2); - make_attr(loc_id,2,dims2,"string2D",type_id,buf12); - status = H5Tclose(type_id); - + + if ((tid = H5Tcopy(H5T_C_S1)) < 0) + goto out; + if (H5Tset_size(tid, (size_t)2) < 0) + goto out; + if (make_attr(loc_id,2,dims2,"string2D",tid,buf12) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf22,0,sizeof buf22); } - + /* buf22[3][2]= {{1,2},{3,4},{5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -4217,17 +4547,20 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 */ - - - type_id = H5Tcopy(H5T_STD_B8LE); - make_attr(loc_id,2,dims2,"bitfield2D",type_id,buf22); - status = H5Tclose(type_id); - + + + if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0) + goto out; + if (make_attr(loc_id,2,dims2,"bitfield2D",tid,buf22) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - + /* buf22[3][2]= {{1,2},{3,4},{5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -4241,11 +4574,15 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 */ - type_id = H5Tcreate(H5T_OPAQUE, (size_t)1); - status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ - make_attr(loc_id,2,dims2,"opaque2D",type_id,buf22); - status = H5Tclose(type_id); - + if ((tid = H5Tcreate(H5T_OPAQUE, (size_t)1)) < 0) + goto out; + if (H5Tset_tag(tid, "1-byte opaque type") < 0) + goto out; + if (make_attr(loc_id,2,dims2,"opaque2D",tid,buf22) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- @@ -4254,7 +4591,7 @@ void write_attr_in(hid_t loc_id, { memset(buf32,0,sizeof buf32); } - + /* buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -4268,14 +4605,19 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 */ - - - type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - make_attr(loc_id,2,dims2,"compound2D",type_id,buf32); - status = H5Tclose(type_id); - + + + if ((tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t))) < 0) + goto out; + if (H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR) < 0) + goto out; + if (H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE) < 0) + goto out; + if (make_attr(loc_id,2,dims2,"compound2D",tid,buf32) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -4287,12 +4629,14 @@ void write_attr_in(hid_t loc_id, { for (j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); + if (H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1) < 0) + goto out; } } - make_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + if (make_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42) < 0) + goto out; } - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- @@ -4304,7 +4648,7 @@ void write_attr_in(hid_t loc_id, if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; } } - + /* Attribute: and position enum2D of enum2D of difference @@ -4316,18 +4660,23 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] RED GREEN [ 2 1 ] RED GREEN */ - - type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(type_id, "RED", (val = 0, &val)); - H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); - make_attr(loc_id,2,dims2,"enum2D",type_id,buf452); - status = H5Tclose(type_id); - + + if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) + goto out; + if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + goto out; + if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + goto out; + if (make_attr(loc_id,2,dims2,"enum2D",tid,buf452) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 3; i++) @@ -4342,7 +4691,7 @@ void write_attr_in(hid_t loc_id, else ((int *)buf52[i][j].p)[l] = n++; } } - + /* position vlen2D of vlen2D of difference ------------------------------------------------------------ @@ -4358,23 +4707,29 @@ void write_attr_in(hid_t loc_id, [ 2 1 ] 10 0 10 [ 2 1 ] 11 0 11 */ - - space_id = H5Screate_simple(2, dims2, NULL); - type_id = H5Tvlen_create(H5T_NATIVE_INT); - attr_id = H5Acreate2(loc_id, "vlen2D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); - status = H5Awrite(attr_id, type_id, buf52); - assert(status >= 0); - status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf52); - assert(status >= 0); - status = H5Aclose(attr_id); - status = H5Tclose(type_id); - status = H5Sclose(space_id); - + + if ((sid = H5Screate_simple(2, dims2, NULL)) < 0) + goto out; + if ((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) + goto out; + if ((aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if (H5Awrite(aid, tid, buf52) < 0) + goto out; + if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52) < 0) + goto out; + if (H5Aclose(aid) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf62,0,sizeof buf62); @@ -4405,15 +4760,18 @@ void write_attr_in(hid_t loc_id, [ 2 1 ] 17 0 17 [ 2 1 ] 18 0 18 */ - type_id = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - make_attr(loc_id, 2, dims2, "array2D", type_id, buf62); - status = H5Tclose(type_id); - + if ((tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray)) < 0) + goto out; + if (make_attr(loc_id, 2, dims2, "array2D", tid, buf62) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - + if(make_diffs) { HDmemset(buf72, 0, sizeof buf72); @@ -4440,93 +4798,99 @@ void write_attr_in(hid_t loc_id, [ 2 0 ] 5 0 5 [ 2 1 ] 6 0 6 */ - - make_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); - make_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - - + + if (make_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72) < 0) + goto out; + if (make_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82) < 0) + goto out; + + /*------------------------------------------------------------------------- * 3D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf13,'z',sizeof buf13); } - + /* buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", "rs","tu","vw","xz","AB","CD","EF","GH", "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; - - Attribute: and - position string3D of string3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] a z - [ 0 0 0 ] b z - [ 0 0 1 ] c z - [ 0 0 1 ] d z - [ 0 1 0 ] e z - [ 0 1 0 ] f z - [ 0 1 1 ] g z - [ 0 1 1 ] h z - [ 0 2 0 ] i z - [ 0 2 0 ] j z - [ 0 2 1 ] k z - [ 0 2 1 ] l z - [ 1 0 0 ] m z - [ 1 0 0 ] n z - [ 1 0 1 ] p z - [ 1 0 1 ] q z - [ 1 1 0 ] r z - [ 1 1 0 ] s z - [ 1 1 1 ] t z - [ 1 1 1 ] u z - [ 1 2 0 ] v z - [ 1 2 0 ] w z - [ 1 2 1 ] x z - [ 2 0 0 ] A z - [ 2 0 0 ] B z - [ 2 0 1 ] C z - [ 2 0 1 ] D z - [ 2 1 0 ] E z - [ 2 1 0 ] F z - [ 2 1 1 ] G z - [ 2 1 1 ] H z - [ 2 2 0 ] I z - [ 2 2 0 ] J z - [ 2 2 1 ] K z - [ 2 2 1 ] L z - [ 3 0 0 ] M z - [ 3 0 0 ] N z - [ 3 0 1 ] P z - [ 3 0 1 ] Q z - [ 3 1 0 ] R z - [ 3 1 0 ] S z - [ 3 1 1 ] T z - [ 3 1 1 ] U z - [ 3 2 0 ] V z - [ 3 2 0 ] W z - [ 3 2 1 ] X z - [ 3 2 1 ] Z z - */ - - type_id = H5Tcopy(H5T_C_S1); - status = H5Tset_size(type_id, (size_t)2); - make_attr(loc_id,3,dims3,"string3D",type_id,buf13); - status = H5Tclose(type_id); - + + Attribute: and + position string3D of string3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] a z + [ 0 0 0 ] b z + [ 0 0 1 ] c z + [ 0 0 1 ] d z + [ 0 1 0 ] e z + [ 0 1 0 ] f z + [ 0 1 1 ] g z + [ 0 1 1 ] h z + [ 0 2 0 ] i z + [ 0 2 0 ] j z + [ 0 2 1 ] k z + [ 0 2 1 ] l z + [ 1 0 0 ] m z + [ 1 0 0 ] n z + [ 1 0 1 ] p z + [ 1 0 1 ] q z + [ 1 1 0 ] r z + [ 1 1 0 ] s z + [ 1 1 1 ] t z + [ 1 1 1 ] u z + [ 1 2 0 ] v z + [ 1 2 0 ] w z + [ 1 2 1 ] x z + [ 2 0 0 ] A z + [ 2 0 0 ] B z + [ 2 0 1 ] C z + [ 2 0 1 ] D z + [ 2 1 0 ] E z + [ 2 1 0 ] F z + [ 2 1 1 ] G z + [ 2 1 1 ] H z + [ 2 2 0 ] I z + [ 2 2 0 ] J z + [ 2 2 1 ] K z + [ 2 2 1 ] L z + [ 3 0 0 ] M z + [ 3 0 0 ] N z + [ 3 0 1 ] P z + [ 3 0 1 ] Q z + [ 3 1 0 ] R z + [ 3 1 0 ] S z + [ 3 1 1 ] T z + [ 3 1 1 ] U z + [ 3 2 0 ] V z + [ 3 2 0 ] W z + [ 3 2 1 ] X z + [ 3 2 1 ] Z z + */ + + if ((tid = H5Tcopy(H5T_C_S1)) < 0) + goto out; + if (H5Tset_size(tid, (size_t)2) < 0) + goto out; + if (make_attr(loc_id,3,dims3,"string3D",tid,buf13) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ - + n=1; for (i = 0; i < 4; i++) { @@ -4539,7 +4903,7 @@ void write_attr_in(hid_t loc_id, } } } - + /* position bitfield3D of bitfield3D of difference ------------------------------------------------------------ @@ -4568,25 +4932,32 @@ void write_attr_in(hid_t loc_id, [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 */ - - type_id = H5Tcopy(H5T_STD_B8LE); - make_attr(loc_id,3,dims3,"bitfield3D",type_id,buf23); - status = H5Tclose(type_id); - + + if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0) + goto out; + if (make_attr(loc_id,3,dims3,"bitfield3D",tid,buf23) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - type_id = H5Tcreate(H5T_OPAQUE, (size_t)1); - status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ - make_attr(loc_id,3,dims3,"opaque3D",type_id,buf23); - status = H5Tclose(type_id); - + if ((tid = H5Tcreate(H5T_OPAQUE, (size_t)1)) < 0) + goto out; + if (H5Tset_tag(tid, "1-byte opaque type") < 0) + goto out; + if (make_attr(loc_id,3,dims3,"opaque3D",tid,buf23) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- */ - + n=1; for (i = 0; i < 4; i++) { @@ -4658,15 +5029,20 @@ void write_attr_in(hid_t loc_id, [ 3 2 1 ] 47 0 47 [ 3 2 1 ] 48 0 48 */ - - - - type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - make_attr(loc_id,3,dims3,"compound3D",type_id,buf33); - status = H5Tclose(type_id); - + + + + if ((tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t))) < 0) + goto out; + if (H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR) < 0) + goto out; + if (H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE) < 0) + goto out; + if (make_attr(loc_id,3,dims3,"compound3D",tid,buf33) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -4679,17 +5055,19 @@ void write_attr_in(hid_t loc_id, for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); + if (H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1) < 0) + goto out; } } - make_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + if (make_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43) < 0) + goto out; } - + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ - + for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) @@ -4707,7 +5085,7 @@ void write_attr_in(hid_t loc_id, } } } - + /* position enum3D of enum3D of difference ------------------------------------------------------------ @@ -4736,19 +5114,24 @@ void write_attr_in(hid_t loc_id, [ 3 2 0 ] GREEN RED [ 3 2 1 ] GREEN RED */ - - - type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(type_id, "RED", (val = 0, &val)); - H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); - make_attr(loc_id,3,dims3,"enum3D",type_id,buf453); - status = H5Tclose(type_id); - + + + if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) + goto out; + if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + goto out; + if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + goto out; + if (make_attr(loc_id,3,dims3,"enum3D",tid,buf453) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 4; i++) @@ -4785,17 +5168,23 @@ void write_attr_in(hid_t loc_id, [ 1 1 0 ] 10 0 10 etc */ - space_id = H5Screate_simple(3, dims3, NULL); - type_id = H5Tvlen_create(H5T_NATIVE_INT); - attr_id = H5Acreate2(loc_id, "vlen3D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); - status = H5Awrite(attr_id, type_id, buf53); - assert(status >= 0); - status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf53); - assert(status >= 0); - status = H5Aclose(attr_id); - status = H5Tclose(type_id); - status = H5Sclose(space_id); - + if ((sid = H5Screate_simple(3, dims3, NULL)) < 0) + goto out; + if ((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) + goto out; + if ((aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if (H5Awrite(aid, tid, buf53) < 0) + goto out; + if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53) < 0) + goto out; + if (H5Aclose(aid) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- @@ -4821,11 +5210,14 @@ void write_attr_in(hid_t loc_id, [ 0 1 0 ] 7 0 7 etc */ - - type_id = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - make_attr(loc_id, 3, dims3, "array3D", type_id, buf63); - status = H5Tclose(type_id); - + + if ((tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray)) < 0) + goto out; + if (make_attr(loc_id, 3, dims3, "array3D", tid, buf63) < 0) + goto out; + if (H5Tclose(tid) < 0) + goto out; + /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- @@ -4850,7 +5242,7 @@ void write_attr_in(hid_t loc_id, } } } - + /* position integer3D of integer3D of difference ------------------------------------------------------------ @@ -4866,145 +5258,279 @@ void write_attr_in(hid_t loc_id, [ 1 1 1 ] 10 0 10 etc */ - make_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); - make_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); + if (make_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73) < 0) + goto out; + if (make_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83) < 0) + goto out; + + + return 0; + +out: + H5E_BEGIN_TRY + { + H5Aclose(aid); + H5Sclose(sid); + H5Tclose(tid); + } H5E_END_TRY; + return -1; } + /*------------------------------------------------------------------------- - * Function: make_dset - * - * Purpose: utility function to create and write a dataset in LOC_ID - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 12, 2003 - * - *------------------------------------------------------------------------- - */ +* Function: make_dset +* +* Purpose: utility function to create and write a dataset in LOC_ID +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 12, 2003 +* +*------------------------------------------------------------------------- +*/ +static int make_dset(hid_t loc_id, const char *name, hid_t sid, hid_t dcpl, void *buf) { - hid_t dsid; + hid_t did=-1; - /* create the dataset */ - if((dsid = H5Dcreate2(loc_id, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if ((did = H5Dcreate2(loc_id, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) return -1; - - /* write */ - if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto out; - - /* close */ - if(H5Dclose(dsid) < 0) + if (H5Dclose(did) < 0) return -1; - return 0; out: H5E_BEGIN_TRY { - H5Dclose(dsid); + H5Dclose(did); } H5E_END_TRY; return -1; } /*------------------------------------------------------------------------- - * Function: write_dset - * - * Purpose: utility function to create and write a dataset in LOC_ID - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 12, 2003 - * - *------------------------------------------------------------------------- - */ - +* Function: write_dset +* +* Purpose: utility function to create and write a dataset in LOC_ID +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 12, 2003 +* +*------------------------------------------------------------------------- +*/ +static int write_dset( hid_t loc_id, - int rank, - hsize_t *dims, - const char *dset_name, - hid_t type_id, - void *buf ) + int rank, + hsize_t *dims, + const char *dset_name, + hid_t tid, + void *buf ) { - hid_t dset_id; - hid_t space_id; + hid_t did=-1; + hid_t sid=-1; - /* Create a buf space */ - if((space_id = H5Screate_simple(rank, dims, NULL)) < 0) + if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) return -1; + if ((did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if (buf) + { + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto out; + } + if (H5Dclose(did) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; - /* Create a dataset */ - if((dset_id = H5Dcreate2(loc_id, dset_name, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - return -1; + return 0; + +out: + H5E_BEGIN_TRY { + H5Dclose(did); + H5Sclose(sid); + } H5E_END_TRY; + return -1; +} - /* Write the buf */ - if(buf) - if(H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - return -1; - /* Close */ - if(H5Dclose(dset_id) < 0) - return -1; - if(H5Sclose(space_id) < 0) - return -1; +/*------------------------------------------------------------------------- +* Function: make_attr +* +* Purpose: utility function to write an attribute in LOC_ID +* +* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* +* Date: November 12, 2003 +* +*------------------------------------------------------------------------- +*/ +static +int make_attr(hid_t loc_id, + int rank, + hsize_t *dims, + const char *attr_name, + hid_t tid, + void *buf) +{ + hid_t aid; + hid_t sid; + + if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) + return -1; + if ((aid = H5Acreate2(loc_id, attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(buf) + { + if(H5Awrite(aid, tid, buf) < 0) + goto out; + } + if (H5Aclose(aid) < 0) + goto out; + if (H5Sclose(sid) < 0) + goto out; return 0; + +out: + H5E_BEGIN_TRY { + H5Aclose(aid); + H5Sclose(sid); + } H5E_END_TRY; + return -1; } /*------------------------------------------------------------------------- - * Function: write_attr - * - * Purpose: utility function to write an attribute in LOC_ID - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 12, 2003 - * - *------------------------------------------------------------------------- - */ - -int make_attr(hid_t loc_id, - int rank, - hsize_t *dims, - const char *attr_name, - hid_t type_id, - void *buf) +* Function: make_named_dtype +* +* Purpose: create a file with named datatypes in various configurations +* +*------------------------------------------------------------------------- +*/ +static +int make_named_dtype(hid_t loc_id) { - hid_t attr_id; - hid_t space_id; + hsize_t dims[1] ={3}; + hid_t did=-1; + hid_t aid=-1; + hid_t sid=-1; + hid_t tid=-1; + hid_t gid=-1; - /* create a space */ - if((space_id = H5Screate_simple(rank, dims, NULL)) < 0) - return -1; + if ((sid = H5Screate_simple(1, dims, NULL)) < 0) + goto out; - /* create the attribute */ - if((attr_id = H5Acreate2(loc_id, attr_name, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto out; + /* Create a dataset with an anonymous committed datatype as the first thing + * h5repack sees */ + if((tid = H5Tcopy(H5T_STD_I16LE)) < 0) + goto out; + if(H5Tcommit_anon(loc_id, tid, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; + if ((did = H5Dcreate2(loc_id, "A", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Tclose(tid) < 0) + goto out; - /* write the buffer */ - if(buf) - if(H5Awrite(attr_id, type_id, buf) < 0) - goto out; + /* Create an attribute on that dataset that uses a committed datatype in + * a remote group */ + if((gid = H5Gcreate2(loc_id, "M", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Gclose(gid) < 0) + goto out; + if((gid = H5Gcreate2(loc_id, "M/M", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Gclose(gid) < 0) + goto out; + if((tid = H5Tcopy(H5T_STD_I16BE)) < 0) + goto out; + if(H5Tcommit2(loc_id, "/M/M/A", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; + if((aid = H5Acreate2(did, "A", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Aclose(aid) < 0) + goto out; + if(H5Tclose(tid) < 0) + goto out; + if(H5Dclose(did) < 0) + goto out; - /* close */ - H5Aclose(attr_id); - H5Sclose(space_id); - return 0; + /* Create a dataset in the remote group that uses a committed datatype in + * the root group */ + if((tid = H5Tcopy(H5T_STD_I32LE)) < 0) + goto out; + if(H5Tcommit2(loc_id, "N", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; + if((did = H5Dcreate2(loc_id, "M/M/B", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Tclose(tid) < 0) + goto out; -out: - H5E_BEGIN_TRY { - H5Aclose(attr_id); - H5Sclose(space_id); - } H5E_END_TRY; - return -1; -} + /* Create an attribute on the remote dataset that uses an anonymous + * committed datatype */ + if((tid = H5Tcopy(H5T_STD_I32BE)) < 0) + goto out; + if(H5Tcommit_anon(loc_id, tid, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto out; + if((aid = H5Acreate2(did, "A", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Aclose(aid) < 0) + goto out; + + /* Create another attribute that uses the same anonymous datatype */ + if((aid = H5Acreate2(did, "B", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Aclose(aid) < 0) + goto out; + if(H5Tclose(tid) < 0) + goto out; + if(H5Dclose(did) < 0) + goto out; + + /* Create a dataset in the root group that uses the committed datatype in + * the root group */ + if((tid = H5Topen2(loc_id, "N", H5P_DEFAULT)) < 0) + goto out; + if((did = H5Dcreate2(loc_id, "O", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Dclose(did) < 0) + goto out; + + /* Create 2 attributes on the committed datatype that use that datatype */ + if((aid = H5Acreate2(tid, "A", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Aclose(aid) < 0) + goto out; + if((aid = H5Acreate2(tid, "B", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + if(H5Aclose(aid) < 0) + goto out; + if(H5Tclose(tid) < 0) + goto out; + + /* Close */ + if (H5Sclose(sid) < 0) + goto out; + return 0; +out: + H5E_BEGIN_TRY + { + H5Tclose(tid); + H5Aclose(aid); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid); + } H5E_END_TRY; + return -1; +} /* end make_named_dtype() */ diff --git a/tools/h5repack/testfiles/h5repack_named_dtypes.h5 b/tools/h5repack/testfiles/h5repack_named_dtypes.h5 new file mode 100644 index 0000000..108bb9f Binary files /dev/null and b/tools/h5repack/testfiles/h5repack_named_dtypes.h5 differ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 3bcdd8c..48957c9 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -391,8 +391,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -520,7 +520,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 3f29521..669917c 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -380,8 +380,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -479,7 +479,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index ebf541e..5d026ea 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -273,12 +273,10 @@ hsize_t diff_array( void *_mem1, nfound=diff_float(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) nfound=diff_double(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); - #if H5_SIZEOF_LONG_DOUBLE !=0 else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE)) nfound=diff_ldouble(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); -#endif - +#endif break; case H5T_INTEGER: @@ -1842,7 +1840,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_FLOAT,&temp2_float); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { if (ABS(temp1_float-temp2_float) > options->delta) @@ -1856,7 +1855,19 @@ hsize_t diff_datum(void *_mem1, nfound++; } - } /* NaN */ + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + } + nfound++; + + } } /*------------------------------------------------------------------------- * !-d and -p @@ -1875,7 +1886,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_FLOAT,&temp2_float); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { PER(temp1_float,temp2_float); @@ -1906,7 +1918,19 @@ hsize_t diff_datum(void *_mem1, nfound++; } - } /* NaN */ + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + } + nfound++; + + } } /*------------------------------------------------------------------------- @@ -1927,7 +1951,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_FLOAT,&temp2_float); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { PER(temp1_float,temp2_float); @@ -1959,7 +1984,19 @@ hsize_t diff_datum(void *_mem1, nfound++; } - } /* NaN */ + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + } + nfound++; + + } } /*------------------------------------------------------------------------- @@ -1991,7 +2028,6 @@ hsize_t diff_datum(void *_mem1, int isnan1=0; int isnan2=0; - assert(type_size==sizeof(double)); memcpy(&temp1_double, mem1, sizeof(double)); @@ -2016,7 +2052,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { if (ABS(temp1_double-temp2_double) > options->delta) @@ -2030,8 +2067,20 @@ hsize_t diff_datum(void *_mem1, nfound++; } - } /* NaN */ - } + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + + } + } /* options->d && !options->p */ /*------------------------------------------------------------------------- * !-d and -p @@ -2050,7 +2099,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { PER(temp1_double,temp2_double); @@ -2082,7 +2132,19 @@ hsize_t diff_datum(void *_mem1, nfound++; } - } /* NaN */ + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + + } } /*------------------------------------------------------------------------- @@ -2102,7 +2164,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { PER(temp1_double,temp2_double); @@ -2135,7 +2198,19 @@ hsize_t diff_datum(void *_mem1, nfound++; } - } /* NaN */ + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + + } } /*------------------------------------------------------------------------- @@ -2194,7 +2269,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { if (ABS(temp1_double-temp2_double) > options->delta) @@ -2228,7 +2304,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { PER(temp1_double,temp2_double); @@ -2280,7 +2357,8 @@ hsize_t diff_datum(void *_mem1, isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { PER(temp1_double,temp2_double); @@ -2791,7 +2869,8 @@ hsize_t diff_float(unsigned char *mem1, isnan2 = my_isnan(FLT_FLOAT,&temp2_float); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { if (ABS(temp1_float-temp2_float) > options->delta) { @@ -2803,7 +2882,19 @@ hsize_t diff_float(unsigned char *mem1, } nfound++; } - } /* NaN */ + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + } + nfound++; + + } mem1+=sizeof(float); mem2+=sizeof(float); if (options->n && nfound>=options->count) @@ -2831,8 +2922,8 @@ hsize_t diff_float(unsigned char *mem1, isnan1 = my_isnan(FLT_FLOAT,&temp1_float); isnan2 = my_isnan(FLT_FLOAT,&temp2_float); } - - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { PER(temp1_float,temp2_float); @@ -2863,7 +2954,19 @@ hsize_t diff_float(unsigned char *mem1, } nfound++; } - } /* NaN */ + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + } + nfound++; + + } mem1+=sizeof(float); mem2+=sizeof(float); if (options->n && nfound>=options->count) @@ -2893,7 +2996,8 @@ hsize_t diff_float(unsigned char *mem1, isnan2 = my_isnan(FLT_FLOAT,&temp2_float); } - if ( !isnan1 && !isnan2) + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) { PER(temp1_float,temp2_float); @@ -2925,7 +3029,19 @@ hsize_t diff_float(unsigned char *mem1, nfound++; } - } /* NaN */ + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + } + nfound++; + + } mem1+=sizeof(float); mem2+=sizeof(float); if (options->n && nfound>=options->count) @@ -2976,7 +3092,6 @@ hsize_t diff_float(unsigned char *mem1, } - /*------------------------------------------------------------------------- * Function: diff_double * @@ -2987,17 +3102,17 @@ hsize_t diff_float(unsigned char *mem1, *------------------------------------------------------------------------- */ hsize_t diff_double(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph) { hsize_t nfound=0; /* number of differences found */ @@ -3006,18 +3121,48 @@ hsize_t diff_double(unsigned char *mem1, hsize_t i; double per; int both_zero; + int isnan1=0; + int isnan2=0; - /* -d and !-p */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (options->d && !options->p) { - for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - if (ABS(temp1_double-temp2_double) > options->delta) + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + } + + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) + { + if (ABS(temp1_double-temp2_double) > options->delta) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + } + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) { if ( print_data(options) ) { @@ -3026,59 +3171,91 @@ hsize_t diff_double(unsigned char *mem1, parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); } nfound++; + } mem1+=sizeof(double); mem2+=sizeof(double); if (options->n && nfound>=options->count) return nfound; - } + } /* i */ } - /* !-d and -p */ + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ else if (!options->d && options->p) { - for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - PER(temp1_double,temp2_double); - - if (not_comparable && !both_zero) /* not comparable */ + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if ( options->do_nans ) { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); - } - nfound++; + isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); } + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) + { - else + PER(temp1_double,temp2_double); - if ( per > options->percent ) + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); + parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, + ABS(temp1_double-temp2_double)); } nfound++; } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) - return nfound; - } + + else + + if ( per > options->percent ) + { + if ( print_data(options) ) + { + print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P,temp1_double,temp2_double, + ABS(temp1_double-temp2_double), + ABS(1-temp2_double/temp1_double)); + } + nfound++; + } + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + + } + mem1+=sizeof(double); + mem2+=sizeof(double); + if (options->n && nfound>=options->count) + return nfound; + } /* i */ } - /* -d and -p */ + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ else if ( options->d && options->p) { @@ -3087,48 +3264,84 @@ hsize_t diff_double(unsigned char *mem1, memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - PER(temp1_double,temp2_double); - - if (not_comparable && !both_zero) /* not comparable */ + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if ( options->do_nans ) { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); - } - nfound++; + isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); } - else + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) + { + + PER(temp1_double,temp2_double); - if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); + parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, + ABS(temp1_double-temp2_double)); } nfound++; } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) - return nfound; - } + + else + + if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) + { + if ( print_data(options) ) + { + print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P,temp1_double,temp2_double, + ABS(temp1_double-temp2_double), + ABS(1-temp2_double/temp1_double)); + } + nfound++; + } + + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + + } + mem1+=sizeof(double); + mem2+=sizeof(double); + if (options->n && nfound>=options->count) + return nfound; + } /* i */ } + + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ else { + + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); + if (equal_double(temp1_double,temp2_double,options)==FALSE) { if ( print_data(options) ) @@ -3144,14 +3357,22 @@ hsize_t diff_double(unsigned char *mem1, mem2+=sizeof(double); if (options->n && nfound>=options->count) return nfound; + } /* nelmts */ + + + + } return nfound; } + + + /*------------------------------------------------------------------------- * Function: diff_ldouble * @@ -3162,19 +3383,19 @@ hsize_t diff_double(unsigned char *mem1, *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE !=0 - + hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph) { hsize_t nfound=0; /* number of differences found */ @@ -3183,79 +3404,141 @@ hsize_t diff_ldouble(unsigned char *mem1, hsize_t i; double per; int both_zero; + int isnan1=0; + int isnan2=0; - /* -d and !-p */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (options->d && !options->p) { - for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(long double)); memcpy(&temp2_double, mem2, sizeof(long double)); - if (ABS(temp1_double-temp2_double) > options->delta) + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + } + + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) + { + if (ABS(temp1_double-temp2_double) > options->delta) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + } + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); } nfound++; + } mem1+=sizeof(long double); mem2+=sizeof(long double); if (options->n && nfound>=options->count) return nfound; - } + } /* i */ } - /* !-d and -p */ + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ else if (!options->d && options->p) { - for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(long double)); memcpy(&temp2_double, mem2, sizeof(long double)); - PER(temp1_double,temp2_double); - - if (not_comparable && !both_zero) /* not comparable */ + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if ( options->do_nans ) { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); - } - nfound++; + isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) + { - else + PER(temp1_double,temp2_double); - if ( per > options->percent ) + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); + parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, + ABS(temp1_double-temp2_double)); } nfound++; } - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) - return nfound; - } + + else + + if ( per > options->percent ) + { + if ( print_data(options) ) + { + print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P,temp1_double,temp2_double, + ABS(temp1_double-temp2_double), + ABS(1-temp2_double/temp1_double)); + } + nfound++; + } + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + + } + mem1+=sizeof(long double); + mem2+=sizeof(long double); + if (options->n && nfound>=options->count) + return nfound; + } /* i */ } - /* -d and -p */ + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ else if ( options->d && options->p) { @@ -3264,55 +3547,91 @@ hsize_t diff_ldouble(unsigned char *mem1, memcpy(&temp1_double, mem1, sizeof(long double)); memcpy(&temp2_double, mem2, sizeof(long double)); - PER(temp1_double,temp2_double); - - if (not_comparable && !both_zero) /* not comparable */ + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if ( options->do_nans ) { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); - } - nfound++; + isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } - else + /* both not NaN, do the comparison */ + if ( isnan1==0 && isnan2==0) + { + + PER(temp1_double,temp2_double); - if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); + parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, + ABS(temp1_double-temp2_double)); } nfound++; } - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) - return nfound; - } + + else + + if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) + { + if ( print_data(options) ) + { + print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P,temp1_double,temp2_double, + ABS(temp1_double-temp2_double), + ABS(1-temp2_double/temp1_double)); + } + nfound++; + } + + } + /* one is NaN, assume difference */ + else if ( isnan1==1 || isnan2==1) + { + if ( print_data(options) ) + { + print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + } + nfound++; + + } + mem1+=sizeof(long double); + mem2+=sizeof(long double); + if (options->n && nfound>=options->count) + return nfound; + } /* i */ } + + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ else { + + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(long double)); memcpy(&temp2_double, mem2, sizeof(long double)); + if (equal_ldouble(temp1_double,temp2_double,options)==FALSE) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); } nfound++; } @@ -3321,15 +3640,24 @@ hsize_t diff_ldouble(unsigned char *mem1, mem2+=sizeof(long double); if (options->n && nfound>=options->count) return nfound; + } /* nelmts */ + + + + } return nfound; } - #endif /* H5_SIZEOF_LONG_DOUBLE */ + + + + + /*------------------------------------------------------------------------- * Function: diff_schar * @@ -5208,12 +5536,7 @@ hbool_t equal_double(double value, double expected, diff_opt_t *options) if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) { return FALSE; - } - - /*------------------------------------------------------------------------- - * both are not NaNs, compare - *------------------------------------------------------------------------- - */ + } } BOTH_ZERO(value,expected) @@ -5274,13 +5597,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) { return FALSE; - } - - /*------------------------------------------------------------------------- - * both are not NaNs, compare - *------------------------------------------------------------------------- - */ - + } } BOTH_ZERO(value,expected) @@ -5344,13 +5661,7 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) { return FALSE; - } - - /*------------------------------------------------------------------------- - * both are not NaNs, compare - *------------------------------------------------------------------------- - */ - + } } BOTH_ZERO(value,expected) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index a295585..0f53192 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -267,7 +267,7 @@ hsize_t diff_datasetid( hid_t did1, if (storage_size1==0 || storage_size2==0) { if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - parallel_print("<%s> or <%s> are empty datasets\n", obj1_name, obj2_name); + parallel_print("Not comparable: <%s> or <%s> are empty datasets\n", obj1_name, obj2_name); can_compare=0; options->not_cmp=1; } @@ -317,7 +317,7 @@ hsize_t diff_datasetid( hid_t did1, { if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("<%s> has sign %s ", obj1_name, get_sign(sign1)); + 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)); } @@ -698,7 +698,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ if ( is_compound ) { - parallel_print("<%s> has a class %s and <%s> has a class %s\n", + parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n", obj1_name, get_class(tclass1), obj2_name, get_class(tclass2) ); @@ -748,7 +748,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("<%s> and <%s> are of class %s\n", + parallel_print("Not comparable: <%s> and <%s> are of class %s\n", obj1_name,obj2_name,get_class(tclass2) ); } can_compare = 0; @@ -793,7 +793,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("<%s> has rank %d, dimensions ", obj1_name, rank1); + parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dimensions(rank1,dims1); parallel_print(", max dimensions "); print_dimensions(rank1,maxdim1); @@ -836,7 +836,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ { if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("<%s> has rank %d, dimensions ", obj1_name, rank1); + parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dimensions(rank1,dims1); if (maxdim1 && maxdim2) { @@ -895,7 +895,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("<%s> has %d members ", obj1_name, nmembs1); + parallel_print("Not comparable: <%s> has %d members ", obj1_name, nmembs1); parallel_print("<%s> has %d members ", obj2_name, nmembs2); parallel_print("\n"); } diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index de1e2c3..03e6efd 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -117,7 +117,7 @@ init_ref_path_table(void) HDassert(thefile > 0); /* Create skip list to store reference path information */ - if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16))==NULL) + if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR))==NULL) return (-1); /* Iterate over objects in this file */ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 98f2d1d..4e95b43 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -411,8 +411,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -554,7 +554,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/tools/testfiles/tall-2A.h5.xml b/tools/testfiles/tall-2A.h5.xml index 314ab4e..ce9df3a 100644 --- a/tools/testfiles/tall-2A.h5.xml +++ b/tools/testfiles/tall-2A.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml -A tall.h5' ############################# - + diff --git a/tools/testfiles/tall.h5.xml b/tools/testfiles/tall.h5.xml index 3747193..e8d39a4 100644 --- a/tools/testfiles/tall.h5.xml +++ b/tools/testfiles/tall.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tall.h5' ############################# - + diff --git a/tools/testfiles/tarray1.h5.xml b/tools/testfiles/tarray1.h5.xml index 8e68659..cff79e3 100644 --- a/tools/testfiles/tarray1.h5.xml +++ b/tools/testfiles/tarray1.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tarray1.h5' ############################# - + diff --git a/tools/testfiles/tarray2.h5.xml b/tools/testfiles/tarray2.h5.xml index b03f44b..f851c18 100644 --- a/tools/testfiles/tarray2.h5.xml +++ b/tools/testfiles/tarray2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tarray2.h5' ############################# - + diff --git a/tools/testfiles/tarray3.h5.xml b/tools/testfiles/tarray3.h5.xml index 5f0959e..a620a5e 100644 --- a/tools/testfiles/tarray3.h5.xml +++ b/tools/testfiles/tarray3.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tarray3.h5' ############################# - + diff --git a/tools/testfiles/tarray6.h5.xml b/tools/testfiles/tarray6.h5.xml index 2b32f99..5be8371 100644 --- a/tools/testfiles/tarray6.h5.xml +++ b/tools/testfiles/tarray6.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tarray6.h5' ############################# - + diff --git a/tools/testfiles/tarray7.h5.xml b/tools/testfiles/tarray7.h5.xml index c7aa380..4fb02c4 100644 --- a/tools/testfiles/tarray7.h5.xml +++ b/tools/testfiles/tarray7.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tarray7.h5' ############################# - + diff --git a/tools/testfiles/tattr.h5.xml b/tools/testfiles/tattr.h5.xml index d5ad730..bfde477 100644 --- a/tools/testfiles/tattr.h5.xml +++ b/tools/testfiles/tattr.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tattr.h5' ############################# - + diff --git a/tools/testfiles/tbitfields.h5.xml b/tools/testfiles/tbitfields.h5.xml index 56c4cd0..28da284 100644 --- a/tools/testfiles/tbitfields.h5.xml +++ b/tools/testfiles/tbitfields.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tbitfields.h5' ############################# - + diff --git a/tools/testfiles/tcompound.h5.xml b/tools/testfiles/tcompound.h5.xml index c6de351..ed255e7 100644 --- a/tools/testfiles/tcompound.h5.xml +++ b/tools/testfiles/tcompound.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tcompound.h5' ############################# - + diff --git a/tools/testfiles/tcompound2.h5.xml b/tools/testfiles/tcompound2.h5.xml index e0b087c..53e9312 100644 --- a/tools/testfiles/tcompound2.h5.xml +++ b/tools/testfiles/tcompound2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tcompound2.h5' ############################# - + diff --git a/tools/testfiles/tcompound_complex.h5.xml b/tools/testfiles/tcompound_complex.h5.xml index 693a5b8..99c1bff 100644 --- a/tools/testfiles/tcompound_complex.h5.xml +++ b/tools/testfiles/tcompound_complex.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tcompound_complex.h5' ############################# - + diff --git a/tools/testfiles/tdatareg.h5.xml b/tools/testfiles/tdatareg.h5.xml index b488409..d7dfad8 100644 --- a/tools/testfiles/tdatareg.h5.xml +++ b/tools/testfiles/tdatareg.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tdatareg.h5' ############################# - + diff --git a/tools/testfiles/tdset.h5.xml b/tools/testfiles/tdset.h5.xml index 990e788..7aedaf5 100644 --- a/tools/testfiles/tdset.h5.xml +++ b/tools/testfiles/tdset.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tdset.h5' ############################# - + diff --git a/tools/testfiles/tdset2.h5.xml b/tools/testfiles/tdset2.h5.xml index 33686e3..3bcaef0 100644 --- a/tools/testfiles/tdset2.h5.xml +++ b/tools/testfiles/tdset2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tdset2.h5' ############################# - + diff --git a/tools/testfiles/tempty-dtd-2.h5.xml b/tools/testfiles/tempty-dtd-2.h5.xml index 70f2567..bf5a5d2 100644 --- a/tools/testfiles/tempty-dtd-2.h5.xml +++ b/tools/testfiles/tempty-dtd-2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml -u tempty.h5' ############################# - + diff --git a/tools/testfiles/tempty-dtd.h5.xml b/tools/testfiles/tempty-dtd.h5.xml index a9bf259..8d15505 100644 --- a/tools/testfiles/tempty-dtd.h5.xml +++ b/tools/testfiles/tempty-dtd.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' ############################# - + diff --git a/tools/testfiles/tempty-nons-2.h5.xml b/tools/testfiles/tempty-nons-2.h5.xml index 94239b4..c9dc971 100644 --- a/tools/testfiles/tempty-nons-2.h5.xml +++ b/tools/testfiles/tempty-nons-2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' ############################# - + diff --git a/tools/testfiles/tempty-nons.h5.xml b/tools/testfiles/tempty-nons.h5.xml index 2a4d9ab..25536d9 100644 --- a/tools/testfiles/tempty-nons.h5.xml +++ b/tools/testfiles/tempty-nons.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml -X : tempty.h5' ############################# - + diff --git a/tools/testfiles/tempty-ns-2.h5.xml b/tools/testfiles/tempty-ns-2.h5.xml index 6102b39..4851e5c 100644 --- a/tools/testfiles/tempty-ns-2.h5.xml +++ b/tools/testfiles/tempty-ns-2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' ############################# - + diff --git a/tools/testfiles/tempty-ns.h5.xml b/tools/testfiles/tempty-ns.h5.xml index 9a1ba94..01ae896 100644 --- a/tools/testfiles/tempty-ns.h5.xml +++ b/tools/testfiles/tempty-ns.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' ############################# - + diff --git a/tools/testfiles/tempty.h5.xml b/tools/testfiles/tempty.h5.xml index 5c642d6..4ff8c95 100644 --- a/tools/testfiles/tempty.h5.xml +++ b/tools/testfiles/tempty.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tempty.h5' ############################# - + diff --git a/tools/testfiles/tenum.h5.xml b/tools/testfiles/tenum.h5.xml index d3e01e5..d8adc1b 100644 --- a/tools/testfiles/tenum.h5.xml +++ b/tools/testfiles/tenum.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tenum.h5' ############################# - + diff --git a/tools/testfiles/textlink.h5.xml b/tools/testfiles/textlink.h5.xml index 0ea7084..f6666a8 100644 --- a/tools/testfiles/textlink.h5.xml +++ b/tools/testfiles/textlink.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml textlink.h5' ############################# - + diff --git a/tools/testfiles/tgroup.h5.xml b/tools/testfiles/tgroup.h5.xml index 4df9638..00f5a0b 100644 --- a/tools/testfiles/tgroup.h5.xml +++ b/tools/testfiles/tgroup.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tgroup.h5' ############################# - + diff --git a/tools/testfiles/thlink.h5.xml b/tools/testfiles/thlink.h5.xml index c2737b9..19bc816 100644 --- a/tools/testfiles/thlink.h5.xml +++ b/tools/testfiles/thlink.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml thlink.h5' ############################# - + diff --git a/tools/testfiles/tloop.h5.xml b/tools/testfiles/tloop.h5.xml index eba827e..d8a5080 100644 --- a/tools/testfiles/tloop.h5.xml +++ b/tools/testfiles/tloop.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tloop.h5' ############################# - + diff --git a/tools/testfiles/tloop2.h5.xml b/tools/testfiles/tloop2.h5.xml index 2eb8e29..73ac4e0 100644 --- a/tools/testfiles/tloop2.h5.xml +++ b/tools/testfiles/tloop2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tloop2.h5' ############################# - + diff --git a/tools/testfiles/tmany.h5.xml b/tools/testfiles/tmany.h5.xml index 93a0610..59b856f 100644 --- a/tools/testfiles/tmany.h5.xml +++ b/tools/testfiles/tmany.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tmany.h5' ############################# - + diff --git a/tools/testfiles/tname-amp.h5.xml b/tools/testfiles/tname-amp.h5.xml index 26df9f5..b443f22 100644 --- a/tools/testfiles/tname-amp.h5.xml +++ b/tools/testfiles/tname-amp.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tname-amp.h5' ############################# - + diff --git a/tools/testfiles/tname-apos.h5.xml b/tools/testfiles/tname-apos.h5.xml index 34fca8b..f60fa48 100644 --- a/tools/testfiles/tname-apos.h5.xml +++ b/tools/testfiles/tname-apos.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tname-apos.h5' ############################# - + diff --git a/tools/testfiles/tname-gt.h5.xml b/tools/testfiles/tname-gt.h5.xml index a30a30c..43d9a50 100644 --- a/tools/testfiles/tname-gt.h5.xml +++ b/tools/testfiles/tname-gt.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tname-gt.h5' ############################# - + diff --git a/tools/testfiles/tname-lt.h5.xml b/tools/testfiles/tname-lt.h5.xml index 4be63e1..4e948c9 100644 --- a/tools/testfiles/tname-lt.h5.xml +++ b/tools/testfiles/tname-lt.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tname-lt.h5' ############################# - + diff --git a/tools/testfiles/tname-quot.h5.xml b/tools/testfiles/tname-quot.h5.xml index 65e46ef..e148630 100644 --- a/tools/testfiles/tname-quot.h5.xml +++ b/tools/testfiles/tname-quot.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tname-quot.h5' ############################# - + diff --git a/tools/testfiles/tname-sp.h5.xml b/tools/testfiles/tname-sp.h5.xml index fbc790c..231d0d5 100644 --- a/tools/testfiles/tname-sp.h5.xml +++ b/tools/testfiles/tname-sp.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tname-sp.h5' ############################# - + diff --git a/tools/testfiles/tnamed_dtype_attr.h5.xml b/tools/testfiles/tnamed_dtype_attr.h5.xml index 2e3cfa3..ebba88b 100644 --- a/tools/testfiles/tnamed_dtype_attr.h5.xml +++ b/tools/testfiles/tnamed_dtype_attr.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tnamed_dtype_attr.h5' ############################# - + diff --git a/tools/testfiles/tnestedcomp.h5.xml b/tools/testfiles/tnestedcomp.h5.xml index 30ee392..a2f928b 100644 --- a/tools/testfiles/tnestedcomp.h5.xml +++ b/tools/testfiles/tnestedcomp.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tnestedcomp.h5' ############################# - + diff --git a/tools/testfiles/tnodata.h5.xml b/tools/testfiles/tnodata.h5.xml index 8b9b3a1..762475e 100644 --- a/tools/testfiles/tnodata.h5.xml +++ b/tools/testfiles/tnodata.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tnodata.h5' ############################# - + diff --git a/tools/testfiles/tobjref.h5.xml b/tools/testfiles/tobjref.h5.xml index 327291e..825cb27 100644 --- a/tools/testfiles/tobjref.h5.xml +++ b/tools/testfiles/tobjref.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tobjref.h5' ############################# - + diff --git a/tools/testfiles/topaque.h5.xml b/tools/testfiles/topaque.h5.xml index 0889251..3f44ace 100644 --- a/tools/testfiles/topaque.h5.xml +++ b/tools/testfiles/topaque.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml topaque.h5' ############################# - + diff --git a/tools/testfiles/torderattr1.h5.xml b/tools/testfiles/torderattr1.h5.xml index fcbe444..15481fc 100644 --- a/tools/testfiles/torderattr1.h5.xml +++ b/tools/testfiles/torderattr1.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=ascending torderattr.h5' ############################# - + diff --git a/tools/testfiles/torderattr2.h5.xml b/tools/testfiles/torderattr2.h5.xml index 5f2b434..ef28140 100644 --- a/tools/testfiles/torderattr2.h5.xml +++ b/tools/testfiles/torderattr2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=descending torderattr.h5' ############################# - + diff --git a/tools/testfiles/torderattr3.h5.xml b/tools/testfiles/torderattr3.h5.xml index 6488711..e9e131a 100644 --- a/tools/testfiles/torderattr3.h5.xml +++ b/tools/testfiles/torderattr3.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=ascending torderattr.h5' ############################# - + diff --git a/tools/testfiles/torderattr4.h5.xml b/tools/testfiles/torderattr4.h5.xml index c6fa0ad..2f4a2ed 100644 --- a/tools/testfiles/torderattr4.h5.xml +++ b/tools/testfiles/torderattr4.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=descending torderattr.h5' ############################# - + diff --git a/tools/testfiles/tref-escapes-at.h5.xml b/tools/testfiles/tref-escapes-at.h5.xml index b7a1158..6d683f1 100644 --- a/tools/testfiles/tref-escapes-at.h5.xml +++ b/tools/testfiles/tref-escapes-at.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' ############################# - + diff --git a/tools/testfiles/tref-escapes.h5.xml b/tools/testfiles/tref-escapes.h5.xml index de42418..6d43069 100644 --- a/tools/testfiles/tref-escapes.h5.xml +++ b/tools/testfiles/tref-escapes.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tref-escapes.h5' ############################# - + diff --git a/tools/testfiles/tref.h5.xml b/tools/testfiles/tref.h5.xml index 6b093de..8a39acf 100644 --- a/tools/testfiles/tref.h5.xml +++ b/tools/testfiles/tref.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tref.h5' ############################# - + diff --git a/tools/testfiles/tsaf.h5.xml b/tools/testfiles/tsaf.h5.xml index 3f4ef38..11808e3 100644 --- a/tools/testfiles/tsaf.h5.xml +++ b/tools/testfiles/tsaf.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tsaf.h5' ############################# - + diff --git a/tools/testfiles/tslink.h5.xml b/tools/testfiles/tslink.h5.xml index 97d49d6..f31f425 100644 --- a/tools/testfiles/tslink.h5.xml +++ b/tools/testfiles/tslink.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tslink.h5' ############################# - + diff --git a/tools/testfiles/tstr.h5.xml b/tools/testfiles/tstr.h5.xml index 4ee36db..aa429a8 100644 --- a/tools/testfiles/tstr.h5.xml +++ b/tools/testfiles/tstr.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tstr.h5' ############################# - + diff --git a/tools/testfiles/tstr2.h5.xml b/tools/testfiles/tstr2.h5.xml index 277d9ae..62283be 100644 --- a/tools/testfiles/tstr2.h5.xml +++ b/tools/testfiles/tstr2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tstr2.h5' ############################# - + diff --git a/tools/testfiles/tstring-at.h5.xml b/tools/testfiles/tstring-at.h5.xml index bd6e412..29e2b90 100644 --- a/tools/testfiles/tstring-at.h5.xml +++ b/tools/testfiles/tstring-at.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tstring-at.h5' ############################# - + diff --git a/tools/testfiles/tstring.h5.xml b/tools/testfiles/tstring.h5.xml index 945f61a..d83ea0e 100644 --- a/tools/testfiles/tstring.h5.xml +++ b/tools/testfiles/tstring.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tstring.h5' ############################# - + diff --git a/tools/testfiles/tudlink.h5.xml b/tools/testfiles/tudlink.h5.xml index 43bf34e..bc55a83 100644 --- a/tools/testfiles/tudlink.h5.xml +++ b/tools/testfiles/tudlink.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tudlink.h5' ############################# - + diff --git a/tools/testfiles/tvldtypes1.h5.xml b/tools/testfiles/tvldtypes1.h5.xml index 8facbec..34eb276 100644 --- a/tools/testfiles/tvldtypes1.h5.xml +++ b/tools/testfiles/tvldtypes1.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tvldtypes1.h5' ############################# - + diff --git a/tools/testfiles/tvldtypes2.h5.xml b/tools/testfiles/tvldtypes2.h5.xml index c741845..d7e644c 100644 --- a/tools/testfiles/tvldtypes2.h5.xml +++ b/tools/testfiles/tvldtypes2.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tvldtypes2.h5' ############################# - + diff --git a/tools/testfiles/tvldtypes3.h5.xml b/tools/testfiles/tvldtypes3.h5.xml index d1122ad..627b2ca 100644 --- a/tools/testfiles/tvldtypes3.h5.xml +++ b/tools/testfiles/tvldtypes3.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tvldtypes3.h5' ############################# - + diff --git a/tools/testfiles/tvldtypes4.h5.xml b/tools/testfiles/tvldtypes4.h5.xml index 8433f48..de2a476 100644 --- a/tools/testfiles/tvldtypes4.h5.xml +++ b/tools/testfiles/tvldtypes4.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tvldtypes4.h5' ############################# - + diff --git a/tools/testfiles/tvldtypes5.h5.xml b/tools/testfiles/tvldtypes5.h5.xml index c4f1eb1..92d5f0c 100644 --- a/tools/testfiles/tvldtypes5.h5.xml +++ b/tools/testfiles/tvldtypes5.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tvldtypes5.h5' ############################# - + diff --git a/tools/testfiles/tvlstr.h5.xml b/tools/testfiles/tvlstr.h5.xml index 98a3b30..5999abd 100644 --- a/tools/testfiles/tvlstr.h5.xml +++ b/tools/testfiles/tvlstr.h5.xml @@ -2,7 +2,7 @@ Expected output for 'h5dump --xml tvlstr.h5' ############################# - + diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 27f611c..6220cf4 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -480,13 +480,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.36-FA_a1" +#define H5_PACKAGE_STRING "HDF5 1.9.39-FA_a1" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.36-FA_a1" +#define H5_PACKAGE_VERSION "1.9.39-FA_a1" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -639,7 +639,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.36-FA_a1" +#define H5_VERSION "1.9.39-FA_a1" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/vms/src/make.com b/vms/src/make.com index 3dcecf1..9ebc858 100644 --- a/vms/src/make.com +++ b/vms/src/make.com @@ -40,7 +40,7 @@ $ cobj= "H5, H5checksum, H5dbg, H5system, H5timer, H5trace,"+- "H5Ffake, H5Fio, H5FL, H5Fmount, H5Fmpi, H5FO, H5Fquery, H5FS, H5FScache, H5FSdbg, H5Fsfile,"+- "H5FSsection, H5FSstat, H5FStest, H5Fsuper, H5Ftest,"+- "H5Gbtree2, H5G, H5Gcache, H5Gcompact, H5Gdense, H5Gdeprec, H5Gent, H5Gint, H5Glink, H5Gloc,"+- - "H5Gname, H5Gnode, H5Gobj, H5Goh, H5Gstab, H5Gtest, H5Gtraverse,"+- + "H5Gname, H5Gnode, H5Gobj, H5Goh, H5Groot, H5Gstab, H5Gtest, H5Gtraverse,"+- "H5HFbtree2, H5HF, H5HFcache, H5HFdbg, H5HFdblock, H5HFdtable, H5HFhdr, H5HFhuge, H5HFiblock,"+- "H5HFiter, H5HFman, H5HFsection, H5HFspace, H5HFstat, H5HFtest, H5HFtiny,"+- "H5HG, H5HGcache, H5HGdbg, H5HL, H5HLcache, H5HLdbg, H5HP, H5I, H5L, H5Lexternal" diff --git a/vms/test/check.com b/vms/test/check.com index 402f17a..1a833dc 100644 --- a/vms/test/check.com +++ b/vms/test/check.com @@ -216,11 +216,6 @@ $ run set_extent $ type sys$input $ type sys$input -------- Running space_overflow ------- -$ run space_overflow -$ type sys$input - -$ type sys$input ------- Running stab ------- $ run stab $ type sys$input diff --git a/vms/test/make.com b/vms/test/make.com index 998b6f8..e4adac9 100644 --- a/vms/test/make.com +++ b/vms/test/make.com @@ -288,12 +288,6 @@ $ link set_extent, - libh5test.olb/lib,[-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib $! $ type sys$input - Creating space_overflow test -$ ccc space_overflow -$ link space_overflow, - - libh5test.olb/lib,[-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib -$! -$ type sys$input Creating stab test $ ccc stab $ link stab, - diff --git a/windows/copy_hdf.bat b/windows/copy_hdf.bat index c9b2957..63ca620 100755 --- a/windows/copy_hdf.bat +++ b/windows/copy_hdf.bat @@ -21,7 +21,6 @@ rem Last Update : November 17, 2007 by Scott Wegner pushd %~dp0 -copy /y src\H5Tinit.c ..\src > nul copy /y src\H5pubconf.h ..\src > nul copy /y fortran\src\H5f90i_gen.h ..\fortran\src > nul copy /y fortran\src\H5fortran_types.f90 ..\fortran\src > nul diff --git a/windows/proj/hdf5/hdf5.vcproj b/windows/proj/hdf5/hdf5.vcproj index cf1b353..37fe50d 100644 --- a/windows/proj/hdf5/hdf5.vcproj +++ b/windows/proj/hdf5/hdf5.vcproj @@ -3511,6 +3511,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + H5TOOLS_MALLOCSIZE + set arg=%file1% -f GZIP=1 + call :tooltest %arg% + + rem Check repacking file with committed datatypes in odd configurations + call :tooltest %file15% + if %nerrors% equ 0 ( echo.All %h5repack% tests passed. diff --git a/windows/tools/testfiles/h5difftst/h5difftst.vcproj b/windows/tools/testfiles/h5difftst/h5difftst.vcproj index 98de07a..61f46cd 100644 --- a/windows/tools/testfiles/h5difftst/h5difftst.vcproj +++ b/windows/tools/testfiles/h5difftst/h5difftst.vcproj @@ -48,7 +48,7 @@ Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" - AdditionalIncludeDirectories="..\..\..\..\src" + AdditionalIncludeDirectories="..\..\..\..\src,..\..\..\..\tools\lib" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" StringPooling="true" RuntimeLibrary="0" @@ -141,7 +141,7 @@ Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" - AdditionalIncludeDirectories="..\..\..\..\src" + AdditionalIncludeDirectories="..\..\..\..\src,..\..\..\..\tools\lib" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" StringPooling="true" RuntimeLibrary="0" @@ -232,7 +232,7 @@ + + + + + + + + + + + + + + + + diff --git a/windows_vnet/proj/hdf5dll/hdf5dll.vcproj b/windows_vnet/proj/hdf5dll/hdf5dll.vcproj index 5177f9f..b18db22 100644 --- a/windows_vnet/proj/hdf5dll/hdf5dll.vcproj +++ b/windows_vnet/proj/hdf5dll/hdf5dll.vcproj @@ -2971,6 +2971,40 @@ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_HDF5DLL_;ZLIB_DLL;_SZDLL_;$(NoInherit)"/> + + + + + + + + + + + + + +